public AcceptThread(NuGenTwoPortService enclosingInstance, int port, System.Collections.ArrayList sockets) { InitBlock(enclosingInstance); System.Net.Sockets.TcpListener temp_tcpListener; temp_tcpListener = new System.Net.Sockets.TcpListener(System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).AddressList[0], port); temp_tcpListener.Start(); ss = temp_tcpListener; this.sockets = sockets; }
public static void Main(System.String[] args) { if (args.Length < 2 || args.Length > 3) { System.Console.Out.WriteLine("Usage: Genetibase.NuGenHL7.app.TwoPortService inbound_port outbound_port [application_spec_file_name]"); System.Environment.Exit(1); } int inPort = 0; int outPort = 0; try { inPort = System.Int32.Parse(args[0]); outPort = System.Int32.Parse(args[1]); } catch (System.FormatException) { System.Console.Error.WriteLine("One of the given ports (" + args[0] + " or " + args[1] + ") is not an integer."); System.Environment.Exit(1); } System.IO.FileInfo appFile = null; if (args.Length == 3) { appFile = new System.IO.FileInfo(args[2]); } try { NuGenTwoPortService server = new NuGenTwoPortService(new PipeParser(), LowerLayerProtocol.makeLLP(), inPort, outPort); if (appFile != null) { server.loadApplicationsFromFile(appFile); } server.start(); } catch (System.Exception e) { SupportClass.WriteStackTrace(e, Console.Error); } }
private void InitBlock(NuGenTwoPortService enclosingInstance) { this.enclosingInstance = enclosingInstance; }