/** * Starts a new thread that listens on the configured port. This method is non-blocking. * * @throws IOException * if a starting to listen fails */ public void startListening() throws IOException { started = true; serverThread = new ServerThread(serverSocketFactory.createServerSocket(port, backlog, bindAddr), maxTPDUSizeParam, maxConnections, messageTimeout, messageFragmentTimeout, connectionListener); serverThread.start(); }
/** * Stop listing on the port. Stops the server thread. */ public void stopListening() { if (serverThread != null) { serverThread.stopServer(); } serverThread = null; started = false; }
/** * Will close the TCP connection if its still open and free any resources of this connection. */ public void close() { if (!closed) { closed = true; try { // will also close socket os.close(); } catch (Exception e) { } try { is.close(); } catch (Exception e) { } if (serverThread != null) { serverThread.connectionClosedSignal(); } } } }
/** * Will close the TCP connection if its still open and free any resources of this connection. */ public void close() { if (!closed) { closed = true; try { // will also close socket os.close(); } catch (Exception e) { } try { is.close(); } catch (Exception e) { } if (serverThread != null) { serverThread.connectionClosedSignal(); } } } }
/** * Starts a new thread that listens on the configured port. This method is non-blocking. * * @throws IOException * if a starting to listen fails */ public void startListening() throws IOException { started = true; serverThread = new ServerThread(serverSocketFactory.createServerSocket(port, backlog, bindAddr), maxTPDUSizeParam, maxConnections, messageTimeout, messageFragmentTimeout, connectionListener); serverThread.start(); }
/** * Stop listing on the port. Stops the server thread. */ public void stopListening() { if (serverThread != null) { serverThread.stopServer(); } serverThread = null; started = false; }
/** * Will close the TCP connection if its still open and free any resources of this connection. */ public void close() { if (!closed) { closed = true; try { // will also close socket os.close(); } catch (Exception e) { } try { is.close(); } catch (Exception e) { } if (serverThread != null) { serverThread.connectionClosedSignal(); } } } }
/** * Starts a new thread that listens on the configured port. This method is non-blocking. * * @throws IOException * if a starting to listen fails */ public void startListening() throws IOException { started = true; serverThread = new ServerThread(serverSocketFactory.createServerSocket(port, backlog, bindAddr), maxTPDUSizeParam, maxConnections, messageTimeout, messageFragmentTimeout, connectionListener); serverThread.start(); }
/** * Stop listing on the port. Stops the server thread. */ public void stopListening() { if (serverThread != null) { serverThread.stopServer(); } serverThread = null; started = false; }