|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-09-16 17:42 UTC] abhishek dot ratani at gmail dot com
Description:
------------
Note that if you set the socket non-blocking via socket_set_blocking() you cannot check if the socket has timed out with this function.
Example:
$status = socket_get_status($fp);
if ($status['timed_out']) {
echo "socket timed out\n";
}
The above condition will never be true even if the socket has timed out.
Is this a bug?
Expected result:
----------------
I except the socket to time out, if the timeout period has passed. But the socket never timesout. Forces me to keep track of time now.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 21:00:01 2025 UTC |
confirm this bug with php 5.0.2. I have the same bug while using Net_SMTP pear class. some of my strace : open("/usr/lib/php/PEAR.php", O_RDONLY) = 4 fstat64(4, {st_mode=S_IFREG|0644, st_size=30146, ...}) = 0 lseek(4, 0, SEEK_CUR) = 0 close(4) = 0 gettimeofday({1097717169, 231500}, NULL) = 0 getpid() = 2346 open("/etc/resolv.conf", O_RDONLY) = 4 fstat64(4, {st_mode=S_IFREG|0644, st_size=118, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x411ef000 read(4, "domain metavers.net\nnameserver 2"..., 4096) = 118 read(4, "", 4096) = 0 close(4) = 0 munmap(0x411ef000, 4096) = 0 socket(PF_UNIX, SOCK_STREAM, 0) = 4 connect(4, {sa_family=AF_UNIX, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory) close(4) = 0 open("/etc/host.conf", O_RDONLY) = -1 ENOENT (No such file or directory) open("/etc/hosts", O_RDONLY) = 4 fcntl64(4, F_GETFD) = 0 fcntl64(4, F_SETFD, FD_CLOEXEC) = 0 fstat64(4, {st_mode=S_IFREG|0644, st_size=716, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x411ef000 read(4, "# /etc/hosts: This file describ"..., 4096) = 716 close(4) = 0 munmap(0x411ef000, 4096) = 0 socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = -1 EAFNOSUPPORT (Address family not supported by protocol)gettimeofday({1097717169, 268504}, NULL) = 0 socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 4 fcntl64(4, F_GETFL) = 0x2 (flags O_RDWR) fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0 connect(4, {sa_family=AF_INET, sin_port=htons(25), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EINPROGRESS (Operation now in progress) select(5, [4], [4], [4], {60, 0}) = 1 (out [4], left {60, 0}) getsockopt(4, SOL_SOCKET, SO_ERROR, [0], [4]) = 0 fcntl64(4, F_SETFL, O_RDWR) = 0 time(NULL) = 1097717169 select(5, [4], NULL, NULL, {60, 0} <unfinished ...>