Date: 12/15/00
- Next message: Andrei Zmievski: "[PHP-DEV] foreach() and list()"
- Previous message: cnewbill <email protected>: "[PHP-DEV] PHP 4.0 Bug #8282: Is there a function for this?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: roman <email protected>
Operating system: FreeBSD 4.1-STABLE
PHP version: 4.0.3pl1
PHP Bug Type: Sockets related
Bug description: Impossible to connect to socket made by other unix daemon...
After creating local Unix (AF_UNIX) socket using other program daemon PHP script with function connect() is not able connect to this socket.
'./configure' '--prefix=/usr/local' '--with-system-regex' '--with-apache=/usr/ports/www/apache13-php3/work/apache_1.3.12' '--with-config-file-path=/usr/local/lib' '--disable-debug' '--enable-track-vars' '--with-gd=/usr/local' '--with-zlib' '--with-mysql=/usr/local' '--with-pgsql' '--with-ndbm' '--enable-wddx' '--includedir=/usr/local' '--enable-sockets'
PHP program text:
$sockfd=socket(AF_UNIX, SOCK_STREAM);
connect($sockfd, "/tmp/my_sock.sock");
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this cause the error
FreeBSD program:
main() {
struct sockaddr_un serv_addr;
int addrlen, old_umask;
int sockfd, ns;
sockfd=socket(AF_UNIX, SOCK_STREAM, 0);
unlink("/tmp/my_sock.sock");
old_umask=umask(0);
bzero(&serv_addr, sizeof(serv_addr));
serv_addr.sun_family=AF_UNIX;
strcpy(serv_addr.sun_path, "/tmp/my_sock.sock");
addrlen=sizeof(serv_addr.sun_family)+strlen(serv_addr.sun_path)+1;
bind(sockfd, (struct sockaddr *)&serv_addr, addrlen);
listen(sockfd, MAX_USERS);
umask(old_umask);
ns=accept(sockfd, (struct sockaddr *)&clnt_addr, &addrlen));
}
-- Edit Bug report at: http://bugs.php.net/?id=8283&edit=1-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Andrei Zmievski: "[PHP-DEV] foreach() and list()"
- Previous message: cnewbill <email protected>: "[PHP-DEV] PHP 4.0 Bug #8282: Is there a function for this?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

