Message()
Description
Creates an instance of Message.
While constructing a Message, 3 parameters can be provided to initialize the message's content: head, body and tail. All 3 parameters are optional.
The head parameter is an object holding varying content according to the protocol being used. See For each protocol.
The tail parameter is also an object holding varying content according to the protocol being used. See For each protocol.
The body parameter can be a Data or a string. When it is a string, it'll be UTF-8 encoded into Data.
Syntax
new Message()new Message(head)new Message(body)new Message(head, body)new Message(head, body, tail)
Parameters
new Message(body?)
A string or a Data object for the message body.
A Message object containing the specified body.
new Message(head, body?, tail?)
Creates an instance of Message.
An object containing protocol-dependent message header.
A string or a Data object for the message body.
An object containing protocol-dependent message footer.
A Message object containing the specified header, footer and body.