internal override void LineTimeoutReceived(object sender, NamedPortEventArgs e) { foreach (VaiTcpIpClient client in clients) { if (string.Compare(client.RemoteSocketName, e.PortLongName, false) == 0) { lock (clientsToBeRemovedLock) { SimpleFileWriter.WriteLineToEventFile(DirectoryName.Diag, "Client in timeout:" + e.PortLongName); MarkClientToBeRemoved(client); break; } } } }
internal static void RaiseTextReceived(INamedPort ivp, string messageText) { int test = 0; try { test = 1; var e = new NamedPortEventArgs(NamedPortEventArgs.PortEventType.TextReceived, messageText, ivp); test++; if (VirtualPortEvent != null) { test = 10; VirtualPortEvent(ivp, e); test = 11; } } catch (Exception ex) { ExceptionHandler.HandleException("RaiseTextReceived:" + test + ">", ex); } }
internal protected void PortEventReceived(object sender, NamedPortEventArgs e) { try { if (e == null || IpAndPort == cDefaultIpAndPort) { return; } string eventLocalPort = (e.Port != null ? e.Port.RemoteSocketName : "Null port"); if (eventLocalPort != IpAndPort) { return; } var eventType = e.PortEvent; if (eventType == NamedPortEventArgs.PortEventType.TextReceived) { parserAssistant.PlainTextReceived(e.Text, e.Port); } else if (eventType == NamedPortEventArgs.PortEventType.DataWithEndCharReceived) { parserAssistant.DataReceived(e.Text, e.Port); } else if (eventType == NamedPortEventArgs.PortEventType.LineIdleTimeout) { LineTimeoutReceived(sender, e); } //else if (e.GetPortEventType == VirtualPortEventArgs.PortEventType.ModemEvent) // ModemEventReceived(e); } catch (Exception ex) { ExceptionHandler.HandleException(ex, "PortEventReceived"); } }
internal static void RaiseTextWithEndCharReceived(INamedPort ivp, string messageText) { var e = new NamedPortEventArgs(NamedPortEventArgs.PortEventType.DataWithEndCharReceived, messageText, ivp); VirtualPortEvent?.Invoke(ivp, e); }
internal static void RaiseByteReceivedEvent(INamedPort ivp, byte messageBytes) { var e = new NamedPortEventArgs(NamedPortEventArgs.PortEventType.ByteReceived, messageBytes, ivp); VirtualPortEvent?.Invoke(ivp, e); }
internal static void RaiseDialUpModemEvent(INamedPort port, string text) { var e = new NamedPortEventArgs(NamedPortEventArgs.PortEventType.ModemEvent, text, port); VirtualPortEvent?.Invoke(port, e); }
internal static void RaiseLineTimeoutEvent(INamedPort ivp) { var e = new NamedPortEventArgs(NamedPortEventArgs.PortEventType.LineIdleTimeout, ivp); VirtualPortEvent?.Invoke(ivp, e); }
internal abstract void LineTimeoutReceived(object sender, NamedPortEventArgs e);