C# Class NATS.Client.Msg

A NATS message is an object encapsulating a subject, optional reply payload, and subscription information, sent or received by teh client application.
Exibir arquivo Open project: nats-io/csnats Class Usage Examples

Public Methods

Method Description
AssignData ( byte data ) : void

Assigns the data of the message. This is a direct assignment, to avoid expensive copy operations. A change to the passed byte array will be changed in the message.

The application is responsible for the data integrity in the message.

Msg ( ) : System

Creates an empty message.

Msg ( string subject ) : System

Creates a message with a subject and no payload.

Msg ( string subject, byte data ) : System

Creates a message with a subject and data.

Msg ( string subject, string reply, byte data ) : System

Creates a message with a subject, reply, and data.

ToString ( ) : string

Generates a string representation of the messages.

Private Methods

Method Description
Msg ( MsgArg arg, Subscription s, byte payload, long length ) : System
init ( string subject, string reply, byte data ) : void

Method Details

AssignData() public method

Assigns the data of the message. This is a direct assignment, to avoid expensive copy operations. A change to the passed byte array will be changed in the message.
The application is responsible for the data integrity in the message.
public AssignData ( byte data ) : void
data byte a bytes buffer of data.
return void

Msg() public method

Creates an empty message.
public Msg ( ) : System
return System

Msg() public method

Creates a message with a subject and no payload.
public Msg ( string subject ) : System
subject string Subject of the message, required.
return System

Msg() public method

Creates a message with a subject and data.
public Msg ( string subject, byte data ) : System
subject string Subject of the message, required.
data byte Message payload
return System

Msg() public method

Creates a message with a subject, reply, and data.
public Msg ( string subject, string reply, byte data ) : System
subject string Subject of the message, required.
reply string Reply subject, can be null.
data byte Message payload
return System

ToString() public method

Generates a string representation of the messages.
public ToString ( ) : string
return string