private void ClosePipeWithError(ServerSideMsgPipe pipe, ServerErrorId error) { try { pipe.SendMessageUsingBuffer(new ServerMsgError(error), _sendBuffer); } finally { pipe.Close(); } }
public void ShouldSerializeAndDeserializeError(ServerErrorId errorId) { var originalMsg = new ServerMsgError(errorId); var buf = CreateBuffer(originalMsg); var written = originalMsg.WriteTo(buf, 0); Assert.True(written == buf.Length); var restoredMsg = new ServerMsgError(buf, 0); Assert.True(originalMsg.ErrorId == restoredMsg.ErrorId); }
public void SessionClosedWithError(string sessionId, ServerErrorId errorId, Exception exception) { Error($"Session {sessionId} closed with error id {errorId}"); Exception(exception); }
public ServerErrorException(ServerErrorId error) { Error = error; }
public ServerMsgError(byte[] buffer, int offset) { MsgSerializer.ValidateHeader(buffer, MsgId, ref offset); ErrorId = (ServerErrorId)MsgSerializer.ReadByte(buffer, ref offset); }
public ServerMsgError(ServerErrorId errorId) { ErrorId = errorId; }