urv.emulator
Class VirtualDatagramSocket

java.lang.Object
  extended by urv.emulator.VirtualDatagramSocket

public class VirtualDatagramSocket
extends java.lang.Object

Author:
Gerard Paris Aixala

Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
VirtualDatagramSocket(int port, java.net.InetAddress addr)
           
 
Method Summary
 void close()
          Closes this virtual datagram socket.
 java.net.InetAddress getLocalAddress()
          Gets the local address to which the socket is bound.
 int getLocalPort()
          Returns the port number on the local host to which this socket is bound.
 int getReceiveBufferSize()
           
 int getSendBufferSize()
           
 boolean isEnabled()
           
 void receive(java.net.DatagramPacket p)
          Receives a datagram packet from this socket.
 void send(java.net.DatagramPacket p)
          Sends a datagram packet from this socket.
 void setReceiveBufferSize(int size)
          Not implemented
 void setSendBufferSize(int size)
          Not implemented
 void setTrafficClass(int tc)
          Not implemented
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log
Constructor Detail

VirtualDatagramSocket

public VirtualDatagramSocket(int port,
                             java.net.InetAddress addr)
                      throws java.net.SocketException
Throws:
java.net.SocketException
Method Detail

close

public void close()
Closes this virtual datagram socket.


receive

public void receive(java.net.DatagramPacket p)
             throws java.io.IOException
Receives a datagram packet from this socket.

Parameters:
p - the DatagramPacket into which to place the incoming data.
Throws:
java.io.IOException

send

public void send(java.net.DatagramPacket p)
          throws java.io.IOException
Sends a datagram packet from this socket.

Parameters:
p -
Throws:
java.io.IOException

setReceiveBufferSize

public void setReceiveBufferSize(int size)
                          throws java.net.SocketException
Not implemented

Parameters:
-
Throws:
java.net.SocketException

setSendBufferSize

public void setSendBufferSize(int size)
                       throws java.net.SocketException
Not implemented

Parameters:
-
Throws:
java.net.SocketException

setTrafficClass

public void setTrafficClass(int tc)
                     throws java.net.SocketException
Not implemented

Parameters:
tc -
Throws:
java.net.SocketException

getLocalAddress

public java.net.InetAddress getLocalAddress()
Gets the local address to which the socket is bound.

Returns:
the local address to which the socket is bound

getLocalPort

public int getLocalPort()
Returns the port number on the local host to which this socket is bound.

Returns:
he port number on the local host to which this socket is bound.

getReceiveBufferSize

public int getReceiveBufferSize()
                         throws java.net.SocketException
Throws:
java.net.SocketException

getSendBufferSize

public int getSendBufferSize()
                      throws java.net.SocketException
Throws:
java.net.SocketException

isEnabled

public boolean isEnabled()