#22358 [Asn->Csd]: it is not possible to open UDP UNIX domain socket using fsockopen()

From: Date: Mon, 31 Mar 2003 12:03:07 +0000
Subject: #22358 [Asn->Csd]: it is not possible to open UDP UNIX domain socket using fsockopen()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-36803@lists.php.net to get a copy of this message
ID: 22358 Updated by: wez@php.net Reported By: joe at ynet dot sk -Status: Assigned +Status: Closed Bug Type: Feature/Change Request Operating System: Linux 2.4.20 PHP Version: 4.3.1 Assigned To: wez New Comment: fsockopen("udg://path/to/sock") should work in PHP5 (try the latest development snapshot if you want to evaluate this). Previous Comments: ------------------------------------------------------------------------ [2003-02-21 17:09:19] wez@php.net Status -> Assigned (so that I can find this report later) ------------------------------------------------------------------------ [2003-02-21 15:40:21] joe at ynet dot sk That should be ok ... I've already rewritten my sw using unix stream sockets. It would be great to have this stuff implemented, since this is the only one of four possibilities (tcp/inet, udp/inet, stream/unix, datagram/unix) that does not work in fsockopen() and as I found out going the other way - socket() - usually requires custom build :). Thnx for fast reply Joe ------------------------------------------------------------------------ [2003-02-21 15:23:26] wez@php.net udp://filename doesn't make sense as udp:// implies a network connection to a host. I guess that you are making a feature request for datagram based unix sockets. I propose something like this: // unix datagram socket $sock = fsockopen("unixdg:///path/to/socket"); // unix stream socket $sock = fsockopen("unix:///path/to/socket"); $sock = fsockopen("/path/to/socket"); I will implement this for PHP 5. ------------------------------------------------------------------------ [2003-02-21 12:14:58] joe at ynet dot sk I don't know whether this is really bug or "feature" - in later case it *should* be mentioned in documentation, that unix domain sockets in fsockopen() are *always* opened using TCP (SOCK_STREAM). I took a look into sources: in main/network.c, function _php_stream_sock_open_unix socketd = socket(PF_UNIX, SOCK_STREAM, 0); no chance for SOCK_DGRAM ... so something like "udp://filename" won't work with fsockopen(). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22358&edit=1

« previous php.bugs (#36803) next »