|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--utilities.Connection
Communicate uses this class to store connection information.
Field Summary | |
static int |
KQML
|
static int |
LENGTHPREFIX
|
static int |
RAW
|
Constructor Summary | |
Connection(java.net.Socket s,
int t,
boolean a)
Constructor, uses default type-specific delimiters. |
|
Connection(java.net.Socket s,
int t,
java.lang.String d,
boolean a)
Constructor |
Method Summary | |
void |
close()
Closes the currently open socket |
java.lang.String |
getDelim()
Gets the message delimiter |
java.io.BufferedReader |
getInput()
Returns the input reader attached to the socket |
java.lang.String |
getLocalHostName()
Returns the host name of the local machine |
int |
getLocalPort()
Returns the local port number |
java.io.BufferedWriter |
getOutput()
Returns the input reader attached to the socket |
java.lang.String |
getRemoteHostName()
Returns the host name of machine attached to this connection |
int |
getRemotePort()
Returns the remote port number |
java.net.Socket |
getSocket()
Gets the socket |
int |
getType()
Returns the connection (pseudo-protocol) type |
boolean |
isDefault()
Gets the default state |
void |
setDefault(boolean d)
Sets the default state |
void |
setDelim(java.lang.String d)
Sets the message delimiter |
void |
setType(int t)
Sets the connection (pseudo-protocol) type |
java.lang.String |
toString()
Stringify me |
boolean |
wasAccepted()
Tells weather this connection was accepted (e.g. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int RAW
public static final int KQML
public static final int LENGTHPREFIX
Constructor Detail |
public Connection(java.net.Socket s, int t, boolean a) throws java.io.IOException
s
- The socket the connection is ont
- The type of connection. RAW, KQML, or LENGTHPREFIX.a
- Did we accepted this connection? (we initiated if false)public Connection(java.net.Socket s, int t, java.lang.String d, boolean a) throws java.io.IOException
s
- The socket the connection is ont
- The type of connectiond
- The message delimietera
- Did we accepted this connection? (we initiated if false)Method Detail |
public int getType()
public void setType(int t)
t
- the new typepublic java.lang.String getRemoteHostName()
public java.lang.String getLocalHostName()
public int getRemotePort()
public int getLocalPort()
public java.io.BufferedReader getInput()
public java.io.BufferedWriter getOutput()
public java.net.Socket getSocket()
public void setDelim(java.lang.String d)
d
- The message delimiterMessage.receive(java.io.BufferedReader, java.lang.String)
public java.lang.String getDelim()
public void close() throws java.io.IOException
public boolean wasAccepted()
public void setDefault(boolean d)
d
- The new statepublic boolean isDefault()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |