php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #44280 socket_send forth argument misdocumented
Submitted: 2008-02-28 05:43 UTC Modified: 2008-10-26 17:58 UTC
From: steve_phpnet at nanovox dot com Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: linux
Private report: No CVE-ID: None
 [2008-02-28 05:43 UTC] steve_phpnet at nanovox dot com
Description:
------------
The fourth (last) argument described on the socket_send function (flags) does not describe the correct set of constants used to get the described effect.  I get a message stating that any of the MSG_ constants are undefined when I attempt to use this function.

Reproduce code:
---------------
$socket = socket_create (AF_INET, SOCK_STREAM, SOL_TCP);
socket_bind ($socket, 'localhost', '54321');
socket_set_block($socket);
socket_listen ($socket);
	
while ($conn = socket_accept ($socket)) {
  socket_send ($conn, "ABCD", 4, MSG_EOF); // MSG_EOF not defined
  socket_close ($conn);
}

socket_close ($socket);

Expected result:
----------------
The expected result is that all four of the MSG_ constants are defined as documented.

Actual result:
--------------
The actual result is that the constants are undefined and the data is never sent over the socket.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-26 17:58 UTC] kalle@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

These constants aren't available on Windows. I added two new sections with information on which constants thats defined on Unix and which thats defined on Windows.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 07:00:01 2026 UTC