Java Socket Port getHostPort(Socket s)

Here you can find the source of getHostPort(Socket s)

Description

get Host Port

License

Open Source License

Declaration

public static String getHostPort(Socket s) 

Method Source Code

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

import java.net.Socket;

public class Main {
    public static String getHostPort(Socket s) {
        String h = s.getInetAddress().getHostAddress().toString();
        int port = s.getPort();
        return h + ":" + port;
    }//from   ww w.j  a v a 2s  .  co m
}

Related

  1. getFreeSocketPort()
  2. getMyPortNumber(ServerSocket serverSocket)
  3. getPort(ServerSocket server)
  4. getRandomPortServerSocket()
  5. getServerSocket(int i_Port)