verinec.netsim.util.net.sockets
Class DatagramSocketImpl
java.lang.Object
java.net.DatagramSocketImpl
verinec.netsim.util.net.sockets.DatagramSocketImpl
- All Implemented Interfaces:
- SocketOptions
public class DatagramSocketImpl
- extends DatagramSocketImpl
| Fields inherited from interface java.net.SocketOptions |
IP_MULTICAST_IF, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS, SO_BINDADDR, SO_BROADCAST, SO_KEEPALIVE, SO_LINGER, SO_OOBINLINE, SO_RCVBUF, SO_REUSEADDR, SO_SNDBUF, SO_TIMEOUT, TCP_NODELAY |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
layer
private TransportLayer layer
thread
private NetSimThread thread
ttl
private int ttl
logger
private ILogger logger
jlogger
private Logger jlogger
localHost
private InetAddress localHost
buffer
private LinkedList buffer
DatagramSocketImpl
public DatagramSocketImpl()
guessLayer
private TransportLayer guessLayer()
bind
protected void bind(int port,
InetAddress host)
throws SocketException
- Specified by:
bind in class DatagramSocketImpl
- Throws:
SocketException- See Also:
DatagramSocketImpl.bind(int, java.net.InetAddress)
setLocalPort
private void setLocalPort(int port)
getLocalPort
public int getLocalPort()
- Overrides:
getLocalPort in class DatagramSocketImpl
- See Also:
DatagramSocketImpl.getLocalPort()
setAddress
private void setAddress(InetAddress host)
close
protected void close()
- Specified by:
close in class DatagramSocketImpl
- See Also:
DatagramSocketImpl.close()
create
protected void create()
throws SocketException
- Specified by:
create in class DatagramSocketImpl
- Throws:
SocketException- See Also:
DatagramSocketImpl.create()
getTTL
protected byte getTTL()
throws IOException
- Deprecated. use getTimeToLive() instead;
- Specified by:
getTTL in class DatagramSocketImpl
- Throws:
IOException- See Also:
DatagramSocketImpl.getTimeToLive()
getTimeToLive
protected int getTimeToLive()
throws IOException
- Specified by:
getTimeToLive in class DatagramSocketImpl
- Throws:
IOException- See Also:
DatagramSocketImpl.getTimeToLive()
join
protected void join(InetAddress arg0)
throws IOException
- Specified by:
join in class DatagramSocketImpl
- Throws:
IOException- See Also:
DatagramSocketImpl.join(java.net.InetAddress)
joinGroup
protected void joinGroup(SocketAddress arg0,
NetworkInterface arg1)
throws IOException
- Specified by:
joinGroup in class DatagramSocketImpl
- Throws:
IOException- See Also:
DatagramSocketImpl.joinGroup(java.net.SocketAddress, java.net.NetworkInterface)
leave
protected void leave(InetAddress arg0)
throws IOException
- Specified by:
leave in class DatagramSocketImpl
- Throws:
IOException- See Also:
DatagramSocketImpl.leave(java.net.InetAddress)
leaveGroup
protected void leaveGroup(SocketAddress arg0,
NetworkInterface arg1)
throws IOException
- Specified by:
leaveGroup in class DatagramSocketImpl
- Throws:
IOException- See Also:
DatagramSocketImpl.leaveGroup(java.net.SocketAddress, java.net.NetworkInterface)
peek
protected int peek(InetAddress arg0)
throws IOException
- Specified by:
peek in class DatagramSocketImpl
- Throws:
IOException- See Also:
DatagramSocketImpl.peek(java.net.InetAddress)
peekData
protected int peekData(DatagramPacket arg0)
throws IOException
- Specified by:
peekData in class DatagramSocketImpl
- Throws:
IOException- See Also:
DatagramSocketImpl.peekData(java.net.DatagramPacket)
receive
protected void receive(DatagramPacket arg0)
throws IOException
- Specified by:
receive in class DatagramSocketImpl
- Throws:
IOException- See Also:
DatagramSocketImpl.receive(java.net.DatagramPacket)
send
protected void send(DatagramPacket arg0)
throws IOException
- Specified by:
send in class DatagramSocketImpl
- Throws:
IOException- See Also:
DatagramSocketImpl.send(java.net.DatagramPacket)
setTTL
protected void setTTL(byte arg0)
throws IOException
- Deprecated. use set TimeToLive instead
- Specified by:
setTTL in class DatagramSocketImpl
- Throws:
IOException- See Also:
DatagramSocketImpl.setTimeToLive(int)
setTimeToLive
protected void setTimeToLive(int arg0)
throws IOException
- Specified by:
setTimeToLive in class DatagramSocketImpl
- Throws:
IOException- See Also:
DatagramSocketImpl.setTimeToLive(int)
getOption
public Object getOption(int arg0)
throws SocketException
- Throws:
SocketException- See Also:
SocketOptions.getOption(int)
setOption
public void setOption(int arg0,
Object arg1)
throws SocketException
- Throws:
SocketException- See Also:
SocketOptions.setOption(int, java.lang.Object)
getLogger
private ILogger getLogger()
setLogger
public void setLogger(ILogger logger)
proccessUp
public void proccessUp(UDPPacket packet)
- Processes the upcoming packet. It's put into the buffer and the waiting thread is activated
- Parameters:
packet - packet that must be processed