uk.ac.ic.doc.automed.p2p.communication
Class TCPClient
java.lang.Object
uk.ac.ic.doc.automed.p2p.communication.AbstractClient
uk.ac.ic.doc.automed.p2p.communication.TCPClient
- All Implemented Interfaces:
- Threadable
public class TCPClient
- extends AbstractClient
|
Method Summary |
void |
handleAction()
Handle thread's interrupted action |
protected static byte[] |
readBytes(java.io.InputStream is,
int bufferSize)
Get bytes array from a TCP input stream |
void |
runAction()
Implement TCP communication process |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TCPClient
public TCPClient(java.lang.String serverHostName,
int serverPort,
RequestListener handler,
int readBufferSize)
TCPClient
public TCPClient(RequestListener handler,
int readBufferSize)
runAction
public void runAction()
throws AutoMedException
- Implement TCP communication process
- Specified by:
runAction in interface Threadable- Specified by:
runAction in class AbstractClient
- Throws:
AutoMedException
handleAction
public void handleAction()
- Handle thread's interrupted action
- Specified by:
handleAction in interface Threadable- Specified by:
handleAction in class AbstractClient
readBytes
protected static byte[] readBytes(java.io.InputStream is,
int bufferSize)
throws java.io.IOException
- Get bytes array from a TCP input stream
- Throws:
java.io.IOException