Exemple #1
0
 public void Dispose()
 {
     try
     {
         stxetxClient.Dispose();
         stxetxClient = null;
     }
     catch
     {
     }
 }
Exemple #2
0
                /// <summary>
                /// constructor for when an STXETX handler is already in place
                /// </summary>
                /// <param name="stxetxClient"></param>
                /// <param name="optionalTS"></param>
                public CommandHandler(StxEtxHandler stxetxClient, TraceSource optionalTS = null)
                {
                    if (optionalTS == null)
                    {
                        ts = new TraceSource("dummy");
                    }
                    else
                    {
                        ts = optionalTS;
                    }

                    this.stxetxClient = stxetxClient;
                }
Exemple #3
0
                /// <summary>
                /// Constructor for when a TCP/IP connection must be established
                /// </summary>
                /// <param name="hostname"></param>
                /// <param name="optionalTS"></param>
                /// <param name="optionalPort"></param>
                public CommandHandler(string hostname, TraceSource optionalTS = null, int optionalPort = 1100)
                {
                    if (optionalTS == null)
                    {
                        ts = new TraceSource("dummy");
                    }
                    else
                    {
                        ts = optionalTS;
                    }

                    LogMsg(TraceEventType.Information, "Initiating connection to: " + hostname);
                    stxetxClient = new StxEtxHandler(new TCPconnManager(ts).ConnectToServer(hostname, optionalPort), true);
                    LogMsg(TraceEventType.Information, "Server connection established.");
                }