|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #78657 'broken pipe' unless socket connected first
Submitted: 2019-10-09 13:47 UTC Modified: 2019-10-13 18:38 UTC
Avg. Score:3.0 ± 1.6
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: a dot a dot paul at gmail dot com Assigned: pollita (profile)
Status: Assigned Package: Sockets related
PHP Version: 7.3.10 OS: Android
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
49 - 20 = ?
Subscribe to this entry?

 [2019-10-09 13:47 UTC] a dot a dot paul at gmail dot com
From manual page:

Documentation states: "Sends a message to a socket, whether it is connected or not"

In practice PHP returns a 'broken pipe' error if the socket is not connected.

See description at stack overflow :

Test script:
    $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);

    $msg = "Ping !";
    $len = strlen($msg);

    socket_connect($sock, '', 1223); // this line missing from documentation

    socket_sendto($sock, $msg, $len, 0, '', 1223);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-10-09 15:52 UTC]
-Assigned To: +Assigned To: pollita
 [2019-10-09 15:52 UTC]
It seems to me the docs are correct.  Sara?
 [2019-10-13 18:38 UTC]
-Package: *General Issues +Package: Sockets related
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Jun 25 16:03:49 2022 UTC