Index: socket-recvfrom.xml =================================================================== RCS file: /repository/phpdoc/en/reference/sockets/functions/socket-recvfrom.xml,v retrieving revision 1.10 diff -u -r1.10 socket-recvfrom.xml --- socket-recvfrom.xml 20 Jun 2007 22:25:25 -0000 1.10 +++ socket-recvfrom.xml 25 Jun 2007 07:40:00 -0000 @@ -3,7 +3,7 @@ socket_recvfrom - Receives data from a socket, connected or not + Receives data from a socket whether or not it is connection-oriented @@ -18,10 +18,135 @@ intport - &warn.undocumented.func; + The socket_recvfrom function receives len + bytes of data in buf from name on port + port (if socket is not of AF_UNIX type) using + socket. socket_recvfrom can be used to + gather data from either a connected or an unconnected socket. Additionally, one or more + flags can be specified to modify the behaviour of the function. + + &reftitle.parameters; + + + + socket + + + The socket must be a socket resource previously created with socket_create(). + + + + + + buf + + + The data received will be fetched to the variable specified with buf. + + + + + + len + + + Up to len bytes will be fetched from remote host. + + + + + + flags + + + The following table contains the different flags that can be set using the + flags parameter. Use the OR logic operator to use more + than one flag. + + + + Available flags + + + + Flag + Description + + + + + MSG_OOB + + Receive out-of-band data. + + + + MSG_PEEK + + Receive data from the beginning of the receive queue without removing + it from the queue. + + + + MSG_WAITALL + + Block until at least len are received. However, + if a signal is caught or the remote host disconnects, the function + may return less data. + + + + MSG_DONTWAIT + + With this flag set, the function returns even if it would normally have + blocked. + + + + +
+
+
+ + + name + + + If the socket is of AF_UNIX type, name is the path to the + file. Else, name is the IP address of the remote host. + + + + + + port + + + This argument only applies to AF_INET and AF_INET6 sockets and specifies the + remote port from which to fetch the data. + + + + +
+
+
+ + + &reftitle.returnvalues; + + socket-recvfrom returns the number of bytes received + or -1 if there was an error. The actual error code can be retrieved by + calling socket_last_error. This error code may be passed + to socket_strerror to get a textual explanation of the + error. + + + + &reftitle.changelog; @@ -46,6 +171,17 @@ + + &reftitle.seealso; + + + socket_recv + socket_send + socket_sendto + socket_create + + +