|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrcssjava.comm.Connection
public class Connection
Handles UDP communication with the Soccer Server
Field Summary | |
---|---|
static int |
MAX_MSG
Maximum message size in bytes |
Constructor Summary | |
---|---|
Connection()
Creates a socket, but doesn't connect to anything |
|
Connection(java.lang.String hostName,
int hostPort)
Creates a socket and connects to host |
Method Summary | |
---|---|
boolean |
connect(java.lang.String hostName,
int hostPort)
Connect to remote host |
void |
disconnect()
Disconnect from server |
boolean |
isConnected()
Is the socket connected? |
java.lang.String |
receive()
Receive data from the server |
boolean |
send(java.lang.String msg)
Send data to server |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_MSG
Constructor Detail |
---|
public Connection()
public Connection(java.lang.String hostName, int hostPort)
hostName
- name or IP address of hosthostPort
- port number on hostMethod Detail |
---|
public boolean connect(java.lang.String hostName, int hostPort)
hostName
- name or IP address of hosthostPort
- port number on host
true
if successfulpublic void disconnect()
public boolean isConnected()
public java.lang.String receive()
public boolean send(java.lang.String msg)
msg
- String to send
true
if successful
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |