private ServerSocket getServerSocket() throws IOException { synchronized (this) { if (_serverSocket == null) _serverSocket = ServerSocketFactory.newServerSocket(); } return _serverSocket; }
public void run() { while (_active) { try { handleNewConnection( getServerSocket().accept() ); Thread.sleep( 20 ); } catch (InterruptedIOException e) { } catch (IOException e) { System.out.println( "Error in pseudo server: " + e ); HttpUnitUtils.handleException(e); } catch (InterruptedException e) { System.out.println( "Interrupted. Shutting down" ); _active = false; } } try { if (_serverSocket != null) ServerSocketFactory.release( _serverSocket ); _serverSocket = null; } catch (IOException e) { } debug( "Pseudoserver shutting down" ); } };
public void run() { while (_active) { try { handleNewConnection( getServerSocket().accept() ); Thread.sleep( 20 ); } catch (InterruptedIOException e) { } catch (IOException e) { System.out.println( "Error in pseudo server: " + e ); HttpUnitUtils.handleException(e); } catch (InterruptedException e) { System.out.println( "Interrupted. Shutting down" ); _active = false; } } try { if (_serverSocket != null) ServerSocketFactory.release( _serverSocket ); _serverSocket = null; } catch (IOException e) { } debug( "Pseudoserver shutting down" ); } };
private ServerSocket getServerSocket() throws IOException { synchronized (this) { if (_serverSocket == null) _serverSocket = ServerSocketFactory.newServerSocket(); } return _serverSocket; }
public void run() { while (_active) { try { handleNewConnection( getServerSocket().accept() ); Thread.sleep( 20 ); } catch (InterruptedIOException e) { } catch (IOException e) { System.out.println( "Error in pseudo server: " + e ); HttpUnitUtils.handleException(e); } catch (InterruptedException e) { System.out.println( "Interrupted. Shutting down" ); _active = false; } } try { if (_serverSocket != null) ServerSocketFactory.release( _serverSocket ); _serverSocket = null; } catch (IOException e) { } debug( "Pseudoserver shutting down" ); } };
private ServerSocket getServerSocket() throws IOException { synchronized (this) { if (_serverSocket == null) _serverSocket = ServerSocketFactory.newServerSocket(); } return _serverSocket; }