java.net
Class PlainDatagramSocketImpl
java.lang.Object
|
+--java.net.DatagramSocketImpl
|
+--java.net.PlainDatagramSocketImpl
This is the default socket implementation for datagram sockets.
It makes native calls to C routines that implement BSD style
SOCK_DGRAM sockets in the AF_INET family.
Author:- Aaron M. Renn (arenn@urbanophile.com)
native_fd
protected int native_fd
This is the actual underlying file descriptor
PlainDatagramSocketImpl
public PlainDatagramSocketImpl()
Default do nothing constructor
bind
protected native synchronized void bind(int port, java.net.InetAddress addr)
Binds this socket to a particular port and interface
Parameters:
Throws:
close
protected native synchronized void close()
Closes the socket
create
protected native synchronized void create()
Creates a new datagram socket
Throws:
getOption
public native synchronized Object getOption(int option_id)
Retrieves the value of an option on the socket
Parameters:
Returns:
Throws:
getTTL
protected synchronized byte getTTL()
Gets the Time to Live value for the socket
Returns:
Throws:
getTimeToLive
protected synchronized int getTimeToLive()
Gets the Time to Live value for the socket
Returns:
Throws:
join
protected native synchronized void join(java.net.InetAddress addr)
Joins a multicast group
Parameters:
Throws:
joinGroup
public void joinGroup(java.net.SocketAddress address, java.net.NetworkInterface netIf)
Parameters:
leave
protected native synchronized void leave(java.net.InetAddress addr)
Leaves a multicast group
Parameters:
Throws:
leaveGroup
public void leaveGroup(java.net.SocketAddress address, java.net.NetworkInterface netIf)
Parameters:
peek
protected synchronized int peek(java.net.InetAddress addr)
What does this method really do?
Parameters:
peekData
public int peekData(java.net.DatagramPacket packet)
Parameters:
receive
protected native synchronized void receive(java.net.DatagramPacket packet)
Receives a UDP packet from the network
Parameters:
Throws:
send
protected synchronized void send(java.net.DatagramPacket packet)
Sends a packet of data to a remote host
Parameters:
Throws:
setOption
public native synchronized void setOption(int option_id, java.lang.Object val)
Sets the value of an option on the socket
Parameters:
Throws:
setTTL
protected synchronized void setTTL(byte ttl)
Sets the Time to Live value for the socket
Parameters:
Throws:
setTimeToLive
protected synchronized void setTimeToLive(int ttl)
Sets the Time to Live value for the socket
Parameters:
Throws: