primitive
Class PortIP

java.lang.Object
  extended byprimitive.PortIP

public class PortIP
extends java.lang.Object

PortIP.java This class provides a representation of a request to connect to a ServerSocket. This 'PIP' object is sent to a ServerSocket and contains information on the client IP and Port so a reciprocal Socket can be set up.

Author:
Avi TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates

Constructor Summary
PortIP(int port, java.lang.String IP, Socket sock)
          Constructor to create a 'PIP' Object.
 
Method Summary
 java.lang.String getIP()
          Returns the IP Address to which the PIP is addressed to.
 int getPort()
          Return the port number.
 Socket getSocket()
          Returns the Socket which initiated the connection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortIP

public PortIP(int port,
              java.lang.String IP,
              Socket sock)
Constructor to create a 'PIP' Object.

Parameters:
port - The port of the ServerSocket we wish to connect to.
IP - The IP address of the ServerSocket we wish to connect to.
sock - The Socket initiating the connection.
Method Detail

getSocket

public Socket getSocket()
Returns the Socket which initiated the connection.

Returns:
The Socket which initiated the connection.

getPort

public int getPort()
Return the port number.

Returns:
The port number.

getIP

public java.lang.String getIP()
Returns the IP Address to which the PIP is addressed to.

Returns:
Destination IP address