|  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:2.0 ± 1.0
Reproduced:0 of 0 (0.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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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-2020 The PHP Group
All rights reserved.
Last updated: Wed Aug 12 13:01:26 2020 UTC