Sends a message to a (unicast) destination. The message contains
- a destination address (Address). A
null
address sends the message to all group members. - a source address. Can be left empty. Will be filled in by the protocol stack.
- a byte buffer. The message contents.
- several additional fields. They can be used by application programs (or patterns). E.g. a message ID, a
oneway
field which determines whether a response is expected etc.
@param msg The message to be sent. Destination and buffer should be set. A null destinationmeans to send to all group members.
@exception ChannelNotConnectedException The channel must be connected to send messages.
@exception ChannelClosedException The channel is closed and therefore cannot be used any longer.A new channel has to be created first.