php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #22358 it is not possible to open UDP UNIX domain socket using fsockopen()
Submitted: 2003-02-21 12:14 UTC Modified: 2003-03-31 06:03 UTC
From: joe at ynet dot sk Assigned: wez (profile)
Status: Closed Package: Feature/Change Request
PHP Version: 4.3.1 OS: Linux 2.4.20
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: joe at ynet dot sk
New email:
PHP Version: OS:

 

 [2003-02-21 12:14 UTC] 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().


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-21 15:23 UTC] 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 15:40 UTC] 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 17:09 UTC] wez@php.net
Status -> Assigned (so that I can find this report later)
 [2003-03-31 06:03 UTC] wez@php.net
fsockopen("udg://path/to/sock") should work in PHP5 (try the latest development snapshot if you want to evaluate this).


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 01:01:30 2024 UTC