next up previous contents
Next: Receiving data Up: Channels Previous: Getting the local and

Sending data to member(s)

Once the channel is connected, messages can be sent:

        public void Send(Message msg) throws ChannelNotConnected, ChannelClosed;

The only argument is the message to be sent. Its destination should either be the address of the receiver (unicast) or null (multicast). When it is null, the message will be sent to all members of the group (including itself). The source address may be null; if it is, it will be set to the channel's address (so that recipients may generate a response and send it back to the sender).

The message is sent asynchronously, i.e. as soon as it is put on the network (usually this means added to the outgoing buffer of the network interface), the method will return. Like UDP, there is no acknowledgment.

If the channel is not connected, or was closed, an exception will be throw upon attempting to send a message.




1999-12-13