void OnData(TcpDataEventArgs args) { // Console.WriteLine("onData..."); EventHandler <TcpDataEventArgs> temp = DataReceived; if (temp != null) { // Console.WriteLine("Calling temp"); temp(this, args); } else { Console.WriteLine("Not calling temp - its null"); } }
private void OnDataReceived(object sender, TcpDataEventArgs e) { if (e.TcpData == null || e.TcpData.Data == null || e.TcpData.RemoteEndpoint == null) { return; } Log.DebugFormat("TCP data packet '{0}' received from '{1}'", e.TcpData.Id, e.TcpData.RemoteEndpoint); lock (SyncLock) { TcpDataQueue.Enqueue(e.TcpData); Log.InfoFormat("TCP data packet '{0}' queued for processing", e.TcpData.Id); } }