jist.swans.app.net
Class UdpSocket.UdpSocketCallback

java.lang.Object
  extended by jist.swans.app.net.UdpSocket.UdpSocketCallback
All Implemented Interfaces:
TransInterface.SocketHandler
Enclosing class:
UdpSocket

public static class UdpSocket.UdpSocketCallback
extends java.lang.Object
implements TransInterface.SocketHandler

Callback for incoming UDP packets.


Nested Class Summary
 
Nested classes/interfaces inherited from interface jist.swans.trans.TransInterface.SocketHandler
TransInterface.SocketHandler.TcpHandler
 
Field Summary
private  Channel channel
          Blocking channel, shared with UdpSocket.
 
Constructor Summary
UdpSocket.UdpSocketCallback(Channel channel)
          Create new socket callback on given UDP socket channel.
 
Method Summary
 void receive(Message msg, NetAddress src, int srcPort)
          Receive transport layer packet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

channel

private Channel channel
Blocking channel, shared with UdpSocket.

Constructor Detail

UdpSocket.UdpSocketCallback

public UdpSocket.UdpSocketCallback(Channel channel)
Create new socket callback on given UDP socket channel.

Parameters:
channel - blocking channel used to deliver packets.
Method Detail

receive

public void receive(Message msg,
                    NetAddress src,
                    int srcPort)
Receive transport layer packet.

Specified by:
receive in interface TransInterface.SocketHandler
Parameters:
msg - incoming packet
src - packet source address
srcPort - packet source port