|
SecurePlayLibray J2SE v2.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.SecurePlay.Comms.SPCcommsHTTP.SocketConnectionHTTP
This class represents an HTTP connection. It also spawns a HTTP listener class in a seperate thread that listens incoming messages. It is also used to send messages out. The reason for this class existence is that a connection can be stored in a map and grabbed to send messages whenever, while the listener it spawned listens to messages.
![]() |
![]() |
| Field Summary | |
(package private) java.net.Socket |
client
This is the socket connection. |
(package private) SPCcommsHTTP |
httpMain
This is the main HTTP driver class that this connection is associated to. |
(package private) java.io.OutputStream |
out
This is the output stream to the socket connection. |
| Constructor Summary | |
SocketConnectionHTTP(java.net.InetAddress address,
int port,
SPCcommsHTTP m)
Constructor is used when a connection needs to be created through a certain port. |
|
SocketConnectionHTTP(java.net.Socket s,
SPCcommsHTTP m)
Constructor is used when a SocketServer recieves a connection and passes the socket to this class. |
|
| Method Summary | |
boolean |
closeConnection()
This method closes the connection and kills the thread that listens to incoming messages. |
void |
incoming(java.lang.String mess)
Passes incoming messages from listener to the main driver. |
void |
write(java.lang.String data)
Writes HTTP formatted messages. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
SPCcommsHTTP httpMain
java.net.Socket client
java.io.OutputStream out
| Constructor Detail |
public SocketConnectionHTTP(java.net.Socket s,
SPCcommsHTTP m)
throws java.io.IOException
java.io.IOExceptions - Socket - connection recieved.m - SPCcommsHTTP - TCP comms driver class that this connection associated to.
public SocketConnectionHTTP(java.net.InetAddress address,
int port,
SPCcommsHTTP m)
throws java.io.IOException
java.io.IOExceptionaddress - InetAddress - address of the connection.port - int - port number that the connection is created.m - SPCcommsHTTP - TCP comms driver class that this connection associated to.| Method Detail |
public void incoming(java.lang.String mess)
mess - byte[] - incoming message to be processed
public void write(java.lang.String data)
throws java.io.IOException
java.io.IOExceptiondata - String - messages to be written.public boolean closeConnection()
java.io.IOException
|
SecurePlayLibray J2SE v2.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||