Bug #14663 Updated: Empty packets as result of serialization
| From: | derick@php.net | Date: | Fri, 28 Jun 2002 07:17:23 +0000 |
| Subject: | Bug #14663 Updated: Empty packets as result of serialization | ||
| References: | 1 | Groups: | php.bugs php.doc |
| Request: | Send a blank email to php-bugs+get-12345@lists.php.net to get a copy of this message | ||
ID: 14663
Updated by: derick@php.net
Reported By: aragon@phat.za.net
-Status: Suspended
+Status: Open
Bug Type: Documentation problem
Operating System: Windows NT 4 sp 6a
PHP Version: 4.1.0
New Comment:
No longer experimental
Previous Comments:
------------------------------------------------------------------------
[2002-02-06 12:44:59] alindeman@php.net
status -> suspended (waiting till it becomes un-experimental ;)
------------------------------------------------------------------------
[2002-02-06 12:43:52] alindeman@php.net
status -> suspended (waiting till it becomes un-experimental ;)
------------------------------------------------------------------------
[2001-12-22 16:22:10] jan@php.net
the manual page is marked as "EXPERIMENTAL". so waiting for the
extension to become stable wil be the best. fixing the example now just
to change it again tomorrow is useless.
------------------------------------------------------------------------
[2001-12-22 15:58:12] mfischer@php.net
Making a documentation problem. Valid sample still have to be written.
------------------------------------------------------------------------
[2001-12-22 15:50:49] aragon@phat.za.net
Example code copy/pasted from
http://www.php.net/manual/en/html/ref.sockets.html
:
<?php
error_reporting (E_ALL);
echo "<h2>TCP/IP Connection</h2>\n";
/* Get the port for the WWW service. */
$service_port = getservbyname ('www', 'tcp');
/* Get the IP address for the target host. */
$address = gethostbyname ('www.php.net');
/* Create a TCP/IP socket. */
$socket = socket_create (AF_INET, SOCK_STREAM, 0);
if ($socket < 0) {
echo "socket_create() failed: reason: " . socket_strerror ($socket)
. "\n";
} else {
"socket_create() successful: " . socket_strerror ($socket) . "\n";
}
echo "Attempting to connect to '$address' on port '$service_port'...";
$result = socket_connect ($socket, $address, $service_port);
if ($result < 0) {
echo "socket_connect() failed.\nReason: ($result) " .
socket_strerror($result) . "\n";
} else {
echo "OK.\n";
}
$in = "HEAD / HTTP/1.0\r\n\r\n";
$out = '';
echo "Sending HTTP HEAD request...";
socket_write ($socket, $in, strlen ($in));
echo "OK.\n";
echo "Reading response:\n\n";
while (socket_read ($socket, $out, 2048)) {
echo $out;
}
echo "Closing socket...";
socket_close ($socket);
echo "OK.\n\n";
?>
When run :
<h2>TCP/IP Connection</h2>
<br>
<b>Warning</b>: socket_strerror() expects parameter 1 to be long,
resource given in <b>/usr/home/aragon/squeakbot/test2</b> on line
<b>18</b><br>
Attempting to connect to '209.61.157.217' on port '80'...OK.
Sending HTTP HEAD request...OK.
Reading response:
<br>
<b>Warning</b>: socket_read() expects parameter 2 to be long, string
given in <b>/usr/home/aragon/squeakbot/test2</b> on line <b>38</b><br>
Closing socket...OK.
Regards,
Aragon
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=14663&edit=1