Code example for Socket

Methods: getLocalPort

0
        } 
    } 
 
    public int getLocalPort() { 
        if (this.socket != null) {
            return this.socket.getLocalPort();
        } else { 
            return -1; 
        } 
    } 
 
    public InetAddress getRemoteAddress() {
        if (this.socket != null) {
            return this.socket.getInetAddress();
        } else { 
            return null; 
        } 
    } 
 
    public int getRemotePort() { 
        if (this.socket != null) {