| ★ wanayoo — archive 1999 http://developer.android.com/reference/java/net/DatagramSocketImpl.html | Nouvelle recherche | Portail wanayoo |
| java.lang.Object | |
| ↳ | java.net.DatagramSocketImpl |
The abstract superclass of datagram & multicast socket implementations.
|
[Expand]
Inherited Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
java.net.SocketOptions
| |||||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| fd | |||||||||||
| localPort | |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an unbound datagram socket implementation.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Answer the nominated socket option.
| |||||||||||
Set the nominated socket option.
| |||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Bind the datagram socket to the nominated localhost/port.
| |||||||||||
Close the socket.
| |||||||||||
Connect the socket to the specified remote address and port.
| |||||||||||
This method allocates the socket descriptor in the underlying operating
system.
| |||||||||||
Disconnect the socket from the remote address and port.
| |||||||||||
Answer the FileDescriptor, which will be invalid if the socket is closed
or not bound.
| |||||||||||
Answer the local port.
| |||||||||||
This method is deprecated.
Replaced by getTimeToLive()
| |||||||||||
Answer the time-to-live (TTL) for multicast packets sent on this socket.
| |||||||||||
Add this socket to the multicast group.
| |||||||||||
Add this socket to the multicast group.
| |||||||||||
Remove the socket from the multicast group.
| |||||||||||
Remove the socket from the multicast group.
| |||||||||||
Peek at the incoming packet to this socket and answer the sender's
address into
sender. | |||||||||||
Receive data into the supplied datagram packet by peeking.
| |||||||||||
Receive data into the supplied datagram packet.
| |||||||||||
Sends the supplied datagram packet.
| |||||||||||
This method is deprecated.
Replaced by setTimeToLive(int)
| |||||||||||
Set the time-to-live (TTL) for multicast packets sent on this socket.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
| |||||||||||
From interface java.net.SocketOptions
| |||||||||||
Constructs an unbound datagram socket implementation.
Answer the nominated socket option.
| optID | the socket option to retrieve |
|---|
| SocketException | thrown if an error occurs while accessing the option |
|---|
Set the nominated socket option.
| optID | the socket option to set |
|---|---|
| val | the option value |
| SocketException | thrown if an error occurs while setting the option |
|---|
Bind the datagram socket to the nominated localhost/port. Sockets must be bound prior to attempting to send or receive data.
| port | the port on the localhost to bind |
|---|---|
| addr | the address on the multihomed localhost to bind |
| SocketException | if an error occurred during bind, such as if the port was already bound |
|---|
Close the socket.
Connect the socket to the specified remote address and port.
| inetAddr | the remote address |
|---|---|
| port | the remote port |
| SocketException | possibly thrown, if the datagram socket cannot be connected to the specified remote address and port |
|---|
This method allocates the socket descriptor in the underlying operating system.
| SocketException |
|---|
Disconnect the socket from the remote address and port.
Answer the FileDescriptor, which will be invalid if the socket is closed or not bound.
Answer the local port. If the socket was bound to any available port, as
flagged by a localPort value of -1, query the IP stack.
This method is deprecated.Replaced by getTimeToLive()
Answer the time-to-live (TTL) for multicast packets sent on this socket.
| IOException | The exception description. |
|---|
Answer the time-to-live (TTL) for multicast packets sent on this socket.
| IOException | The exception description. |
|---|
Add this socket to the multicast group. A socket must join a group before data may be received. A socket may be a member of multiple groups but may join any group once.
| addr | the multicast group to be joined |
|---|
| IOException | may be thrown while joining a group |
|---|
Add this socket to the multicast group. A socket must join a group before data may be received. A socket may be a member of multiple groups but may join any group once.
| addr | the multicast group to be joined |
|---|---|
| netInterface | the network interface on which the addresses should be dropped |
| IOException | may be thrown while joining a group |
|---|
Remove the socket from the multicast group.
| addr | the multicast group to be left |
|---|
| IOException | May be thrown while leaving the group |
|---|
Remove the socket from the multicast group.
| addr | the multicast group to be left |
|---|---|
| netInterface | the network interface on which the addresses should be dropped |
| IOException | May be thrown while leaving the group |
|---|
Peek at the incoming packet to this socket and answer the sender's
address into sender. The method will block until a packet
is received or timeout expires and returns the sender's port.
| IOException | if a read error or timeout occurs |
|---|
Receive data into the supplied datagram packet by peeking. The data is not removed and will be received by another peekData() or receive() call. This call will block until either data is received or, if a timeout is set, the timeout expires.
| pack | the DatagramPacket used to store the data |
|---|
| IOException | if an error occurs |
|---|
Receive data into the supplied datagram packet. This call will block until either data is received or, if a timeout is set, the timeout expires. If the timeout expires, the InterruptedIOException is thrown.
| IOException | if a read error or timeout occurs |
|---|
Sends the supplied datagram packet. The packet contains the destination host & port.
| pack | DatagramPacket to send |
|---|
| IOException | if a write error occurs |
|---|
This method is deprecated.Replaced by setTimeToLive(int)
Set the time-to-live (TTL) for multicast packets sent on this socket.
| ttl | the time-to-live, 0 < ttl <= 255 |
|---|
| IOException | The exception thrown while setting the TTL |
|---|
Set the time-to-live (TTL) for multicast packets sent on this socket.
| ttl | the time-to-live, 0 < ttl <= 255 |
|---|
| IOException | The exception thrown while setting the TTL |
|---|