| 97 | |
| 98 | // start connect session in worker thread |
| 99 | public void connect(EventReceiver parent_arg) { |
| 100 | if (connect_called) |
| 101 | throw new ConnectCalledTwice(); |
| 102 | connect_called = true; |
| 103 | |
| 104 | // direct client callbacks to parent |
| 105 | parent = parent_arg; |
| 106 | |
| 107 | // clear status |
| 108 | m_connect_status = null; |
| 109 | |
| 110 | // execute client in a worker thread |
| 111 | thread = new Thread(this, "OpenVPNClientThread"); |
| 112 | thread.start(); |
| 113 | } |
| 114 | |
| 115 | // Wait for worker thread to complete; to stop thread, |
| 116 | // first call super stop() method then wait_thread(). |