note 125895 added to function.socket-recv
| From: | Anonymous@php.net | Date: | Wed, 10 Mar 2021 09:49:31 +0000 |
| Subject: | note 125895 added to function.socket-recv | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219314@lists.php.net to get a copy of this message | ||
<?php
namespace Safe;
use Safe\Exceptions\SocketsException;
/**
* After the socket socket has been created
* using socket_create, bound to a name with
* socket_bind, and told to listen for connections
* with socket_listen, this function will accept
* incoming connections on that socket. Once a successful connection
* is made, a new socket resource is returned, which may be used
* for communication. If there are multiple connections queued on
* the socket, the first will be used. If there are no pending
* connections, socket_accept will block until
* a connection becomes present. If socket
* has been made non-blocking using
* socket_set_blocking or
* socket_set_nonblock, FALSE will be returned.
*
* The socket resource returned by
* socket_accept may not be used to accept new
* connections. The original listening socket
* socket, however, remains open and may be
* reused.
*
* @param resource $socket A valid socket resource created with socket_create.
* @return resource Returns a new socket resource on success. 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.
* @throws SocketsException
*
*/
function socket_accept($socket)
{
error_clear_last();
$result = \socket_accept($socket);
if ($result === false) {
throw SocketsException::createFromPhpError();
}
return $result;
}
/**
* Create a Socket resource, and bind it to the provided AddrInfo resource. The return
* value of this function may be used with socket_listen.
*
* @param resource $addr Resource created from socket_addrinfo_lookup.
* @return resource Returns a Socket resource on success.
* @throws SocketsException
*
*/
function socket_addrinfo_bind($addr)
{
error_clear_last();
$result = \socket_addrinfo_bind($addr);
if ($result === null) {
throw SocketsException::createFromPhpError();
}
return $result;
}
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.246 (proxied: 185.92.25.201)
----
Manual Page -- http://php.net/manual/en/function.socket-recv.php
Edit -- https://master.php.net/note/edit/125895
Del: integrated -- https://master.php.net/note/delete/125895/integrated
Del: useless -- https://master.php.net/note/delete/125895/useless
Del: bad code -- https://master.php.net/note/delete/125895/bad+code
Del: spam -- https://master.php.net/note/delete/125895/spam
Del: non-english -- https://master.php.net/note/delete/125895/non-english
Del: in docs -- https://master.php.net/note/delete/125895/in+docs
Del: other reasons-- https://master.php.net/note/delete/125895
Reject -- https://master.php.net/note/reject/125895
Search -- https://master.php.net/manage/user-notes.php