| receive |
(DatagramSocket socket, String buf [, Pointer addr, Pointer port]) |
yoix.net |
| |
Uses
socket,
which should be a
DatagramSocket
or a
MulticastSocket,
to wait for a datagram to arrive, stores the packet data in
buf,
and returns the number of bytes received or
-1
if
receive
timed out, was interrupted, or encountered any other kind of error.
receive
automatically activates
socket
if it is not alive.
The string buffer
buf
must be large enough to accommodate the data in any expected packet;
bytes that don't fit will be lost.
Information about where the data came from can stored in the locations
that the optional
addr
and
port
arguments point to.
The string buffer
buf
must be large enough to accommodate the data in any expected packet;
bytes that don't fit will be lost.
Information about where the data came from can stored in the locations
that the optional
addr
and
port
arguments point to.
addr
should point to a string that will be filled in with the IP address
of the host that sent the data.
port
should point to an integer that will be filled in with a port that
can be used to contact the host that sent the data.
If
socket
is connected to a remote system then
receive
can only receive packets from that system, which means the optional
addr
and
port
arguments will not provide any additional information.
|
Yoix is a registered trademark of AT&T Inc.
|