Class OpenIGTServer

java.lang.Object
org.medcare.igtl.network.OpenIGTServer
Direct Known Subclasses:
GenericIGTLinkServer

public abstract class OpenIGTServer extends Object

The class can be used to create a server listening a port Messages received will be queued and proceed

  • Field Details

  • Constructor Details

    • OpenIGTServer

      public OpenIGTServer(int port, ErrorManager errorManager) throws Exception
      Default MessageQueueManager constructor.
      Parameters:
      port - port on which this server will be bind
      errorManager - main class running this server
      Throws:
      Exception
  • Method Details

    • startServer

      public void startServer(int port) throws IOException
      Throws:
      IOException
    • startListening

      public void startListening(int port)
    • stopServer

      public void stopServer()
    • sendMessage

      public void sendMessage(OpenIGTMessage message) throws Exception
      Sends a message up the link
      Throws:
      Exception
    • getMessageHandler

      public abstract MessageHandler getMessageHandler(Header header, byte[] bodyBuf, ServerThread serverThread)
      ** To get message Handler
      Parameters:
      header - header of the message received
      bodyBuf - byte array of the body of the message received
      serverThread - serverThread managing connection of client where does come from the message **
      Returns:
      the message Handler
    • setServerThread

      public void setServerThread(ServerThread thread)
    • getServerThread

      public ServerThread getServerThread()
    • getKeepAlive

      public boolean getKeepAlive()
      Returns:
      the killAlive
    • setKeepAlive

      public void setKeepAlive(boolean keepAlive)
    • getCurrentStatus

      public OpenIGTServer.ServerStatus getCurrentStatus()
      Returns:
      the currentStatus
    • setCurrentStatus

      public void setCurrentStatus(OpenIGTServer.ServerStatus currentStatus)
      Parameters:
      currentStatus - the currentStatus to set
    • isConnected

      public boolean isConnected()