### Question:
TcpListener extends Connection<SessionListener<Socket>> implements Transport<SessionListener<Socket>> { @Override public void close( boolean reset ) throws Exception { ServerSocket ss = serverSocket; if (ss != null) { serverSocket = null; ss.close(); } } TcpListener( String uri, Resources resources );  TcpListener( URL uri, Resources resources ); private  TcpListener( String host, int port, int backlog ); @Override String toString(); @Override void close( boolean reset ); @Override SocketAddress localAddress(); @Override SocketAddress remoteAddress(); final static String BACKLOG; }### Answer:
@Test public void accept1() throws Exception { MyListenerHandler lh = new MyListenerHandler(); TcpListener l = new TcpListener( "tcp: l.setSession( lh ); l.start(); l.waitUp( TIMEOUT ); Socket s = new Socket( "127.0.0.1", 4008 ); assertWhat( What.ACCEPTED, lh.what ); assertNotNull( lh.xsocket ); assertEquals( s.getLocalSocketAddress(), lh.xsocket.getRemoteSocketAddress() ); assertEquals( s.getRemoteSocketAddress(), lh.xsocket.getLocalSocketAddress() ); s.getOutputStream().write( 23 ); s.getOutputStream().flush(); assertEquals( 23, lh.xsocket.getInputStream().read() ); lh.xsocket.getOutputStream().write( 23 ); lh.xsocket.getOutputStream().flush(); assertEquals( 23, s.getInputStream().read() ); s.close(); lh.xsocket.close(); l.stop(); l.waitDown( TIMEOUT ); }