TCPServer Class

Summary

TCPServer listens for HL7 requests.

Syntax
C#
VB
C++
Public Class TCPServer  
public class TCPServer : IDisposable 
public ref class TCPServer  
Example

This example shows how to use TCPServer to start an HL7 server.

C#
VB
using Leadtools; 
using LeadtoolsExamples.Common; 
using Leadtools.Medical.HL7; 
using Leadtools.Medical.HL7.V2x.Models; 
using Leadtools.Medical.HL7.V2x.Listener; 
using Leadtools.Medical.HL7.V2x.Sender; 
using Leadtools.Medical.HL7.V26.Messages; 
 
public static void HL7Server() 
{ 
   TCPServer _server = null; 
   IPEndPoint EndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 6787); 
 
   try 
   { 
      using (_server = new TCPServer(EndPoint)) 
      { 
         _server.RequestHandlerType = typeof(HL7Request); 
         _server.Start(); 
      } 
   } 
   catch 
   { 
      Console.WriteLine("crashed"); 
   } 
   finally 
   { 
      _server = null; 
   } 
} 
Imports Leadtools 
Imports LeadtoolsDocumentsExamples.LeadtoolsExamples.Common 
Imports Leadtools.Medical.HL7 
Imports Leadtools.Medical.HL7.V2x.Models 
Imports Leadtools.Medical.HL7.V2x.Listener 
Imports Leadtools.Medical.HL7.V2x.Sender 
Imports Leadtools.Medical.HL7.V26.Messages 
 
Public Shared Sub HL7Server() 
   Dim EndPoint As IPEndPoint = New IPEndPoint(IPAddress.Parse("127.0.0.1"), 6787) 
 
   Try 
      Using _server As TCPServer = New TCPServer(EndPoint) 
         _server.RequestHandlerType = GetType(HL7Request) 
         _server.Start() 
      End Using 
   Catch 
      Console.WriteLine("crashed") 
   End Try 
End Sub 
Requirements

Target Platforms

Help Version 21.0.2021.6.30
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Medical.HL7 Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.