ID: 30121 Updated by: [EMAIL PROTECTED] Reported By: abhishek dot ratani at gmail dot com -Status: Open +Status: Feedback Bug Type: Sockets related Operating System: Linux PHP Version: 5.0.1 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2004-10-14 03:43:45] bchesneau at gmail dot com 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 ...> ------------------------------------------------------------------------ [2004-09-16 17:42:43] 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30121&edit=1