Code example for ServerSocketChannel

Methods: close

0
 
    /* ------------------------------------------------------------ */ 
    public void close() throws IOException 
    { 
        if (_acceptChannel != null)
            _acceptChannel.close();
        _acceptChannel=null;
    } 
     
    /* ------------------------------------------------------------ */ 
    public void accept(int acceptorID)
    	throws IOException, InterruptedException 
    {    
        SocketChannel channel = _acceptChannel.accept();
        channel.configureBlocking(true);
        Socket socket=channel.socket();
        configure(socket);
 
        Connection connection=new Connection(channel);
        connection.dispatch();
Contextual code suggestions in your IDE  Get Codota for Java