|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--context.arch.comm.protocol.TCPClientSocket
This class implements a simple client socket that sends TCP packets. It does nothing with the TCP packets themselves but can be subclassed to do real work.
Field Summary | |
static int |
DEFAULT_PORT
The default port number to use is 5555 |
static java.lang.String |
DEFAULT_SERVER
The default hostname of the remote server |
protected int |
portNumber
|
protected java.lang.String |
remoteServer
|
Constructor Summary | |
TCPClientSocket()
Default constructor for TCPClientSocket, with the default port and remote server hostname |
|
TCPClientSocket(int port)
TCPClientSocket constructor with user-specified port and remote server hostname |
|
TCPClientSocket(java.lang.String server,
int port)
TCPClientSocket constructor with user-specified port and remote server hostname |
Method Summary | |
int |
getPort()
Returns the port number on the remote host to connect to |
java.lang.String |
getServer()
Returns the remote server's hostname |
void |
setPort(int port)
Sets the port number on the remote host to connect to |
void |
setServer(java.lang.String server)
Sets the remote server's hostname |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int DEFAULT_PORT
public static final java.lang.String DEFAULT_SERVER
protected int portNumber
protected java.lang.String remoteServer
Constructor Detail |
public TCPClientSocket()
DEFAULT_PORT
,
DEFAULT_SERVER
public TCPClientSocket(int port)
port
- Port number to useDEFAULT_SERVER
public TCPClientSocket(java.lang.String server, int port)
server
- Hostname of remote server to connect toport
- Port number to useMethod Detail |
public void setServer(java.lang.String server)
server
- Name of the remote server to connect topublic java.lang.String getServer()
public void setPort(int port)
port
- Port number on the remote host to connect topublic int getPort()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |