ServerSocket GetInetAddress() Example
Returns the local address of this server socket
ServerSocketclass GetInetAddress() method example. This example shows you how to use GetInetAddress() method.This method Returns the local address of this server socket
Here is the code:-
/**
* @Program that Returns the local address of this server socket.
* GetInetAddress.java
* Author:-RoseIndia Team
* Date:-21-jun-2008
*/
import java.net.*;
public class GetInetAddress {
public static void main(String[] args) throws Exception {
InetAddress i = InetAddress.getByName("girish-desktop");
ServerSocket ss = new ServerSocket(8080, 0, i);
//Returns the local address of this server socket
System.out.println(ss.getInetAddress());
}
} |
|