Code example for ServerSocketChannel

Methods: close

0
        } 
    } 
 
    synchronized public void stopServer() { 
        try { 
            serverChannel.close();
        } 
        catch (IOException ex) {
            Logger.logError(ex, "There was an error closing the server channel.");
        } 
    } 
     
    String getHostName() {
        return serverChannel.socket().getInetAddress().getHostName();
    } 
 
    String getHostAddr() {
        return serverChannel.socket().getInetAddress().getHostAddress();
    } 
} 
Experience pair programming with AI  Get Codota for Java