/// <summary> /// Sends error message /// </summary> ///<exception cref="ConnectionIsLostException"></exception> ///<exception cref="LocalSerializationException">specified serializer does not fit the arguments</exception> public void SendError(ErrorMessage errorInfo) { var stream = _channel.CreateStreamForSend(); Tools.WriteShort((short)Messenger.ExceptionMessageTypeId, to: stream); new ErrorMessageSerializer().SerializeT(errorInfo, stream); stream.Position = 0; _channel.WriteAsync(stream).Wait(); }