|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: a dot a dot paul at gmail dot com
New email:
PHP Version: OS:


 [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-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 14 01:01:27 2024 UTC