Java SocketChannel remoteAddress(SocketChannel channel)

Here you can find the source of remoteAddress(SocketChannel channel)

Description

remote Address

License

Open Source License

Declaration

public static String remoteAddress(SocketChannel channel) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.net.SocketAddress;

import java.nio.channels.SocketChannel;

public class Main {
    public static String remoteAddress(SocketChannel channel) {
        SocketAddress addr = channel.socket().getRemoteSocketAddress();
        String res = String.format("%s", addr);
        return res;
    }//from  w ww  .  jav  a  2s  .c o m
}

Related

  1. getConnectedSocketChannel(InetAddress host, int port, int timeout)
  2. getSocketAddress(SocketChannel socketChannel)
  3. getSocketDisplayString(SocketChannel channel)
  4. openSocketChannel(SocketAddress sa)
  5. pingWithSocketChannel()
  6. sendFile(FileChannel fileChannel, SocketChannel socketChannel)
  7. tune_tcp_socket(SocketChannel ch)
  8. tuneTcpKeepalives(SocketChannel ch, int tcpKeepalive, int tcpKeepaliveCnt, int tcpKeepaliveIdle, int tcpKeepaliveIntvl)