private void _Package(byte[] bytes) { var pkg = (TPackage)_Serializer.Deserialize(bytes); _DoneEvent.Invoke(pkg); if (_Stop == false) { _ReadHead(); } }
private void _Package(byte[] bytes) { TPackage pkg = (TPackage)_Serializer.Deserialize(bytes); if (pkg == null) { ErrorEvent(); return; } _DoneEvent.Invoke(pkg); if (_Stop == false) { _ReadHead(); } }