uk.ac.ic.doc.automed.p2p.communication
Class TCPClient

java.lang.Object
  extended by uk.ac.ic.doc.automed.p2p.communication.AbstractClient
      extended by uk.ac.ic.doc.automed.p2p.communication.TCPClient
All Implemented Interfaces:
uk.ac.ic.doc.automed.util.thread.Threadable

public class TCPClient
extends AbstractClient


Field Summary
 
Fields inherited from class uk.ac.ic.doc.automed.p2p.communication.AbstractClient
ackExpected, dataToSend, handler, serverHostName, serverPort
 
Constructor Summary
TCPClient(java.lang.String serverHostName, int serverPort, RequestListener handler, int readBufferSize)
           
 
Method Summary
static java.io.InputStream getReplyForRequest(uk.ac.ic.doc.automed.p2p.messages.abstractlayer.AbstractMessage request, java.net.InetAddress address, int port)
          A deprecated method: use runAction() instead
 void handleAction()
          Handle thread's interrupted action
 void runAction()
          Implement TCP communication process
 
Methods inherited from class uk.ac.ic.doc.automed.p2p.communication.AbstractClient
setDataToSend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TCPClient

public TCPClient(java.lang.String serverHostName,
                 int serverPort,
                 RequestListener handler,
                 int readBufferSize)
Method Detail

getReplyForRequest

public static java.io.InputStream getReplyForRequest(uk.ac.ic.doc.automed.p2p.messages.abstractlayer.AbstractMessage request,
                                                     java.net.InetAddress address,
                                                     int port)
                                              throws java.io.IOException
A deprecated method: use runAction() instead

Throws:
java.io.IOException

runAction

public void runAction()
               throws AutoMedException
Implement TCP communication process

Specified by:
runAction in interface uk.ac.ic.doc.automed.util.thread.Threadable
Specified by:
runAction in class AbstractClient
Throws:
AutoMedException

handleAction

public void handleAction()
Handle thread's interrupted action

Specified by:
handleAction in interface uk.ac.ic.doc.automed.util.thread.Threadable
Specified by:
handleAction in class AbstractClient