org.openuat.util
Interface MessageListener


public interface MessageListener

This is a very simple interface to listen to incoming messages for connectionless protocols, e.g. UDP.

Version:
1.0
Author:
Rene Mayrhofer

Method Summary
 void handleMessage(byte[] message, int offset, int length, java.lang.Object sender)
          This message is called for each incoming message.
 

Method Detail

handleMessage

void handleMessage(byte[] message,
                   int offset,
                   int length,
                   java.lang.Object sender)
This message is called for each incoming message. Note: Each implementation must be thread-safe, because this method can be called simultaneously from different threads.

Parameters:
message - The message itself. Depending on the protocol, it might be out-of-order and packet delivery might not be guaranteed at all.
offset - The offset at which the message starts in the message array.
length - The number of bytes in message that belong to the message itself.
sender - The sender of the message, e.g. an InetAddress or Inet6Address object for UDP packets.


2005-2006, Rene Mayrhofer.