private void OnRawDataReceived(ITcpConnection connection, IEnumerable <ArraySegment <byte> > data) { try { _framer.UnFrameData(data); } catch (PackageFramingException exc) { _log.Error(exc, "TcpPackageConnection: [{0}, L{1}, {2:B}]. Invalid TCP frame received.", RemoteEndPoint, LocalEndPoint, ConnectionId); Close("Invalid TCP frame received."); return; } //NOTE: important to be the last statement in the callback connection.ReceiveAsync(OnRawDataReceived); }
private void OnRawDataReceived(ITcpConnection connection, IEnumerable <ArraySegment <byte> > data) { try { _framer.UnFrameData(data); } catch (PackageFramingException exc) { Log.Debug(exc, "Invalid TCP frame received."); Close(); return; } connection.ReceiveAsync(OnRawDataReceived); }
private void OnRawDataReceived(ITcpConnection connection, IEnumerable <ArraySegment <byte> > data) { _framer.UnFrameData(data); connection.ReceiveAsync(OnRawDataReceived); }