Class TwoPortService

All Implemented Interfaces:
Runnable

public class TwoPortService extends HL7Service
A TCP/IP-based HL7 Service that uses separate ports for inbound and outbound messages. A connection is only activated when the same remote host connects to both the inbound and outbound ports.
Author:
Bryan Tripp
  • Constructor Details

  • Method Details

    • afterStartup

      protected void afterStartup()
      Launches two threads that concurrently listen on the inboundPort and outboundPort.
      Overrides:
      afterStartup in class HL7Service
      See Also:
    • afterTermination

      protected void afterTermination()
      Terminate the two acceptor threads
      Overrides:
      afterTermination in class HL7Service
      See Also:
    • handle

      protected void handle()
      Polls for accepted sockets
      Specified by:
      handle in class Service
    • createAcceptThread

      protected ca.uhn.hl7v2.app.AcceptorThread createAcceptThread(int port)
    • main

      public static void main(String[] args)
      Run server from command line. Inbound and outbound port numbers should be provided as arguments, and a file containing a list of Applications to use can also be specified as an optional argument (as per super.loadApplicationsFromFile(...)). Uses the default LowerLayerProtocol.