public void stopTcpConnector() throws Exception { if (tcpConnector == null || tcpConnThread == null) { return; } tcpConnector.stop(); tcpConnThread.join(); }
public void initTcpConnector() throws Exception { if (!"YES".equalsIgnoreCase(PropertyUtil.getProperty("TCP_CONNECTOR_ENABLE"))) { return; } tcpConnector = new NIOTcpConnector(); tcpConnThread = new Thread(tcpConnector, "IMServer-NIOTcpConnector"); synchronized (tcpConnector) { tcpConnThread.start(); tcpConnector.wait(); } }