|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnetwork.AbCommsTCP
network.SocketComms
public class SocketComms
Created on November 5, 2006, 9:14 AM
Handles communications when sending data to a remote host.
Extends AbCommsTCP, sends the data packet in a loop until the loop is terminated.
The communication loop is terminated either by the object using SocketComms, such as when an ack is received, or if no ack is required.
t.5 Changes from using datagrampackets to using a bufferedInputStream from a socket connection.
| Constructor Summary | |
|---|---|
SocketComms()
Creates a new instance of SocketComms |
|
| Method Summary | |
|---|---|
void |
run()
Handles running the thread. |
void |
sendSocket()
Sends the data buffer to the remote host. |
void |
setTheSocket(java.net.InetAddress theAddress,
int port)
Creates a new socket for connecting. |
void |
stopComms()
Stops comms. Calls the super.stopComms in AbComms and tries to close the output stream. |
| Methods inherited from class network.AbCommsTCP |
|---|
addPropertyChangeListener, getBuffer, getConnectedAddress, getPort, getPropertySupport, getRemoteHost, getRunner, getSocket, isAckRequired, isAlreadyConnected, isPauseComms, isRunning, removePropertyChangeListener, setAckRequired, setAlreadyConnected, setBuffer, setConnectedAddress, setPauseComms, setPort, setRemoteHost, setRunner, setRunning, setSocket, startComms |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SocketComms()
| Method Detail |
|---|
public void setTheSocket(java.net.InetAddress theAddress,
int port)
theAddress - The address of the remote host to connect to.port - The port on the remote host to connect to.public void sendSocket()
public void run()
run in interface java.lang.Runnablerun in class AbCommsTCPpublic void stopComms()
stopComms in class AbCommsTCP
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||