jist.swans.app.net
Class UdpSocket

java.lang.Object
  extended by jist.swans.app.net.UdpSocket

public class UdpSocket
extends java.lang.Object

The SWANS target of all java.net.DatagramSocket calls.

Since:
SWANS1.0

Nested Class Summary
static class UdpSocket.UdpSocketCallback
          Callback for incoming UDP packets.
 
Constructor Summary
  UdpSocket()
           
protected UdpSocket(java.net.DatagramSocketImpl impl)
           
  UdpSocket(int port)
           
  UdpSocket(int port, java.net.InetAddress addr)
           
  UdpSocket(java.net.SocketAddress addr)
           
 
Method Summary
 void _jistPostInit()
          Post-constructor call.
 void bind(java.net.SocketAddress addr)
           
 void close()
           
 void receive(java.net.DatagramPacket p)
           
 void send(java.net.DatagramPacket p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UdpSocket

public UdpSocket()
See Also:
DatagramSocket

UdpSocket

protected UdpSocket(java.net.DatagramSocketImpl impl)
See Also:
DatagramSocket

UdpSocket

public UdpSocket(int port)
See Also:
DatagramSocket

UdpSocket

public UdpSocket(int port,
                 java.net.InetAddress addr)
See Also:
DatagramSocket

UdpSocket

public UdpSocket(java.net.SocketAddress addr)
See Also:
DatagramSocket
Method Detail

_jistPostInit

public void _jistPostInit()
Post-constructor call. Since constructors can not be blocking (JiST/Java limitation), we rewrite a regular socket constructor to two calls. This is the second one, and it can be blocking, because it is a regular method.


bind

public void bind(java.net.SocketAddress addr)
See Also:
DatagramSocket

close

public void close()
See Also:
DatagramSocket

receive

public void receive(java.net.DatagramPacket p)
See Also:
DatagramSocket

send

public void send(java.net.DatagramPacket p)
See Also:
DatagramSocket