Class OpenIGTClient

java.lang.Object
java.lang.Thread
org.medcare.igtl.network.OpenIGTClient
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
GenericIGTLinkClient

public abstract class OpenIGTClient extends Thread

The class can be used by first connecting to a server sending requests comming from the requestQueue, listening for response and adding response to the responsqueue

  • Field Details

  • Constructor Details

  • Method Details

    • run

      public void run()
      Reader thread. Reads messages from the socket and add them to the ResponseQueueManager
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • setSocketFactory

      public void setSocketFactory(SocketFactory socketFactory)
    • sendMessage

      public void sendMessage(OpenIGTMessage message) throws Exception
      Throws:
      Exception
    • sendMessage

      public void sendMessage(Header header, byte[] body) throws Exception
      Throws:
      Exception
    • sendBytes

      public final boolean sendBytes(byte[] bytes) throws IOException
      Sends bytes

      Parameters:
      bytes - - byte[] array.
      Throws:
      IOException - - Exception in I/O.

    • interrupt

      public void interrupt()
      Interrupt this thread
      Overrides:
      interrupt in class Thread
    • getStatus

      public Status getStatus()
      ** To set server status **
      Returns:
      the status status
    • setStatus

      public void setStatus(Status status)
      ** To set server status
      Parameters:
      status - **
    • getResponseHandler

      public abstract ResponseHandler getResponseHandler(Header header, byte[] bodyBuf)
      ** To get response Handler
      Parameters:
      header - header of the message received
      bodyBuf - byte array of the body of the message received **
      Returns:
      the response Handler
    • isConnected

      public boolean isConnected()