int _err = (errn); /* save value to avoid repeated calls to WSAGetLastError() on Windows */ \
(socket)->error = _err; \
SOCKETS_G(last_error) = _err; \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s [%d]: %s", msg, _err, php_strerror(_err TSRMLS_CC)); \
+ if (_err != EAGAIN && _err != EWOULDBLOCK && _err != EINPROGRESS) { \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s [%d]: %s", msg, _err, php_strerror(_err TSRMLS_CC)); \
+ } \
} while (0)
ZEND_BEGIN_MODULE_GLOBALS(sockets)
if (!socket_set_nonblock($socket)) {
die('Unable to set nonblocking mode for socket');
}
- socket_recvfrom($socket, $buf, 12, 0, $from, $port); // cause warning
+ var_dump(socket_recvfrom($socket, $buf, 12, 0, $from, $port)); //false (EAGAIN - no warning)
$address = '127.0.0.1';
socket_sendto($socket, '', 1, 0, $address); // cause warning
if (!socket_bind($socket, $address, 1223)) {
socket_close($socket);
--EXPECTF--
-Warning: socket_recvfrom(): unable to recvfrom [%d]: %a in %s on line %d
+bool(false)
Warning: Wrong parameter count for socket_sendto() in %s on line %d
if (!socket_set_nonblock($socket)) {
die('Unable to set nonblocking mode for socket');
}
- socket_recvfrom($socket, $buf, 12, 0, $from, $port); // cause warning
+ var_dump(socket_recvfrom($socket, $buf, 12, 0, $from, $port)); // false (EAGAIN, no warning)
$address = '::1';
socket_sendto($socket, '', 1, 0, $address); // cause warning
if (!socket_bind($socket, $address, 1223)) {
socket_close($socket);
--EXPECTF--
-Warning: socket_recvfrom(): unable to recvfrom [11]: Resource temporarily unavailable in %s on line %d
+bool(false)
Warning: Wrong parameter count for socket_sendto() in %s on line %d
if (!socket_set_nonblock($socket)) {
die('Unable to set nonblocking mode for socket');
}
- socket_recvfrom($socket, $buf, 12, 0, $from, $port); // cause warning
+ var_dump(socket_recvfrom($socket, $buf, 12, 0, $from, $port)); //false (EAGAIN, no warning)
$address = sprintf("/tmp/%s.sock", uniqid());
if (!socket_bind($socket, $address)) {
die("Unable to bind to $address");
?>
--EXPECTF--
Warning: socket_create(): Unable to create socket [%d]: Protocol not supported in %s on line %d
-
-Warning: socket_recvfrom(): unable to recvfrom [%d]: Resource temporarily unavailable in %s on line %d
+bool(false)
Warning: socket_sendto() expects at least 5 parameters, 4 given in %s on line %d
bool(false)