Socket getRemoteSocketAddress Example

Socket class getRemoteSocketAddress example. This example shows you how to use getRemoteSocketAddress method.


Socket class getRemoteSocketAddress example.

Here is the code
/*
 * @ # GetReceiveBufferSize.java
 * A class repersenting use to getReceiveBufferSize method 
 * of NumberFormat class in java.text package
 * version 17 June 2008
 * author Rose India 
 */

import java.net.*;

public class GetRemoteSocketAddress {

    public static void main(String args[]) throws Exception {

        Socket socket = new Socket();

        //Connects this socket to the server.
        socket.connect(new InetSocketAddress("192.168.10.211"8080));

        System.out.println(socket.getRemoteSocketAddress());

        //close socket
        socket.close();
    }
}

Output
/192.168.10.211:8080

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US