Class NetMQMessageCodec
Implements
IMessageCodec<NetMQMessage>
Namespace: Libplanet.Net.Messages
Assembly: Libplanet.Net.dll
Syntax
public class NetMQMessageCodec : object, IMessageCodec<NetMQMessage>
Constructors
| Improve this Doc View SourceNetMQMessageCodec()
Creates a NetMQMessageCodec instance.
Declaration
public NetMQMessageCodec()
Methods
| Improve this Doc View SourceDecode(NetMQMessage, Boolean)
Decodes given encoded
into
Message and checks its validity.
Encode(Message, PrivateKey, AppProtocolVersion, BoundPeer, DateTimeOffset)
Declaration
public Message Decode(NetMQMessage encoded, bool reply)
Parameters
Type | Name | Description |
---|---|---|
NetMQMessage | encoded | |
Boolean | reply | A flag to express whether the target is a reply of other message. |
Returns
Type | Description |
---|---|
Message | A Message parsed from |
Exceptions
Type | Condition |
---|---|
InvalidMessageSignatureException | Thrown when the signer of
|
Encode(Message, PrivateKey, AppProtocolVersion, BoundPeer, DateTimeOffset)
Encodes the message to privateKey
and peer
.
Declaration
public NetMQMessage Encode(Message message, PrivateKey privateKey, AppProtocolVersion appProtocolVersion, BoundPeer peer, DateTimeOffset timestamp)
Parameters
Type | Name | Description |
---|---|---|
Message | message | The message to encode. |
PrivateKey | privateKey | The PrivateKey to sign the encoded message. |
AppProtocolVersion | appProtocolVersion | The AppProtocolVersion of the transport layer. |
BoundPeer | peer | The BoundPeer-typed representation of the transport layer. AsPeer |
DateTimeOffset | timestamp | The |
Returns
Type | Description |
---|---|
NetMQMessage | A |
Exceptions
Type | Condition |
---|---|
InvalidCredentialException | Thrown when |