public static DuplexMessage CreateCallbackMessage(DuplexMessage commandMessage, object content = null) { if (content != null) { return(new DuplexMessage(new MessageHeader( commandMessage.Header.MessageID, commandMessage.Header.Version, commandMessage.Header.Identifier, commandMessage.Header.FilterCode, commandMessage.Header.FilterType | MessageFilterType.Compression, MessageState.Success, ErrorCode.NoError, commandMessage.Header.SerializeMode, commandMessage.Header.CommandCode, MessageType.Callback), content)); } else { return(new DuplexMessage(new MessageHeader( commandMessage.Header.MessageID, commandMessage.Header.Version, commandMessage.Header.Identifier, MessageFilterFactory.CreateDefaultFilterCode(), MessageFilterType.Checksum, MessageState.Success, ErrorCode.NoError, SerializeMode.None, commandMessage.Header.CommandCode, MessageType.Callback), content)); } }
public static DuplexMessage CreateCommandMessage( string messageId, MessageVersion version, CommandCode commandCode) { return(CreateCommandMessage( messageId, version, commandCode, MessageFilterType.Checksum, MessageFilterFactory.CreateDefaultFilterCode(), SerializeMode.None, null)); }
public static DuplexMessage CreateCallbackMessage(DuplexMessage commandMessage, ErrorCode errorCode) { return(new DuplexMessage(new MessageHeader( commandMessage.Header.MessageID, commandMessage.Header.Version, commandMessage.Header.Identifier, MessageFilterFactory.CreateDefaultFilterCode(), MessageFilterType.Checksum, MessageState.Fail, errorCode, SerializeMode.None, commandMessage.Header.CommandCode, MessageType.Callback), null)); }
public static DuplexMessage CreateCommandMessage( string messageId, MessageVersion version, string identifier, ErrorCode errorCode, CommandCode commandCode) { return(CreateCommandMessage( messageId, version, identifier, MessageFilterType.Checksum, MessageFilterFactory.CreateDefaultFilterCode(), MessageState.Fail, errorCode, SerializeMode.None, commandCode)); }
public static DuplexMessage CreateAckMessage( string messageId, MessageVersion version, string identifier, CommandCode commandCode, ErrorCode errorCode) { return(new DuplexMessage(new MessageHeader( messageId, version, identifier, MessageFilterFactory.CreateDefaultFilterCode(), MessageFilterType.Checksum, MessageState.Fail, errorCode, SerializeMode.None, commandCode, MessageType.CommandAck), null)); }
public static DuplexMessage CreateHeartbeat() { using (var scope = ObjectHost.Host.BeginLifetimeScope()) { return(new DuplexMessage(new MessageHeader( Guid.NewGuid().ToByteArray().ToBase64(), MessageVersion.V1, scope.Resolve <IIdentifierProvider>().GetIdentifier(), MessageFilterFactory.CreateDefaultFilterCode(), MessageFilterType.Checksum, MessageState.Success, ErrorCode.NoError, SerializeMode.None, CommandCode.Heartbeat, MessageType.Heartbeat), null)); } }
public static DuplexMessage CreateCommandMessage( string messageId, MessageVersion version, string identifier, MessageFilterType filterType, byte[] filterCode, MessageState state, ErrorCode errorCode, SerializeMode serializeMode, CommandCode commandCode, object content = null) { if (content != null) { return(new DuplexMessage(new MessageHeader( messageId, version, identifier, filterCode, filterType, state, errorCode, serializeMode, commandCode, MessageType.Command), content)); } else { return(new DuplexMessage(new MessageHeader( messageId, version, identifier, MessageFilterFactory.CreateDefaultFilterCode(), MessageFilterType.Checksum, state, errorCode, SerializeMode.None, commandCode, MessageType.Command), null)); } }
public static DuplexMessage CreateCommandMessage( string messageId, MessageVersion version, CommandCode commandCode, MessageFilterType filterType, byte[] filterCode, SerializeMode serializeMode, object content) { var identifier = ObjectHost.Host.Resolve <IIdentifierProvider>().GetIdentifier(); if (content != null) { return(CreateCommandMessage( messageId, version, identifier, filterType, filterCode, MessageState.Success, ErrorCode.NoError, serializeMode, commandCode, content)); } else { return(CreateCommandMessage( messageId, version, identifier, MessageFilterType.Checksum, MessageFilterFactory.CreateDefaultFilterCode(), MessageState.Success, ErrorCode.NoError, SerializeMode.None, commandCode)); } }