示例#1
0
 private void ClosePipeWithError(ServerSideMsgPipe pipe, ServerErrorId error)
 {
     try {
         pipe.SendMessageUsingBuffer(new ServerMsgError(error), _sendBuffer);
     }
     finally {
         pipe.Close();
     }
 }
示例#2
0
        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);
        }
示例#3
0
 public void SessionClosedWithError(string sessionId, ServerErrorId errorId, Exception exception)
 {
     Error($"Session {sessionId} closed with error id {errorId}");
     Exception(exception);
 }
示例#4
0
 public ServerErrorException(ServerErrorId error)
 {
     Error = error;
 }
示例#5
0
 public ServerMsgError(byte[] buffer, int offset)
 {
     MsgSerializer.ValidateHeader(buffer, MsgId, ref offset);
     ErrorId = (ServerErrorId)MsgSerializer.ReadByte(buffer, ref offset);
 }
示例#6
0
 public ServerMsgError(ServerErrorId errorId)
 {
     ErrorId = errorId;
 }