Ejemplo n.º 1
0
        private TcpConnectorException(string message, Exception innerException, TcpConnectorAction operation, TcpConnectorErrorType errorType)
            : base(message, innerException)
        {
            if (operation < TcpConnectorAction.Connecting || operation > TcpConnectorAction.Receive)
            {
                throw new InvalidEnumArgumentException(nameof(operation), (int)operation, typeof(TcpConnectorAction));
            }
            if (errorType < TcpConnectorErrorType.Unknown || errorType > TcpConnectorErrorType.WrongPacket)
            {
                throw new InvalidEnumArgumentException(nameof(errorType), (int)errorType, typeof(TcpConnectorErrorType));
            }

            _action    = operation;
            _errorType = errorType;
        }
Ejemplo n.º 2
0
 public TcpConnectorException(TcpConnectorAction operation, TcpConnectorErrorType errorType, string message, Exception innerException)
     : this(message, innerException, operation, errorType)
 {
 }
Ejemplo n.º 3
0
 public TcpConnectorException(TcpConnectorAction operation, TcpConnectorErrorType errorType)
     : this(string.Empty, null, operation, errorType)
 {
 }
Ejemplo n.º 4
0
 protected TcpConnectorException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _action    = (TcpConnectorAction)info.GetInt32(nameof(Action));
     _errorType = (TcpConnectorErrorType)info.GetInt32(nameof(ErrorType));
 }