|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-12-08 22:21 UTC] okwoks at yahoo dot com
I use socket to develope my web application. It works fine when i'm using PHP 4.2.2. The problem is when i ugraded it to 4.3.0RC2, there's an error stating - PHP has encountered an Access Violation at 017C29CD Does PHP 4.3.0RC2 have a stable socket dll? PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 11:00:01 2025 UTC |
Hi, I'm doing an web application which connects to a delphi app by using sockets to transmit data. My delphi program will reply automatically when it receive a data. However, after i upgraded to PHP 4.3.0RC2, it doesn't work and came out this error- PHP has encountered an Access Violation at 00000001 Below here are my codes that use to connect to the delphi program. $add="180.10.0.1"; //ST8000 machine's ip address $port="5000"; $rc_no=50; global $chr; $chr = ""; $changes=0; $data = ""; $socket = socket_create (AF_INET, SOCK_STREAM, 0); if ($socket < 0) { echo "socket_create() failed: reason: " . socket_strerror ($socket) . "\n"; } @$result = socket_connect ($socket, $add, $port); if ($result < 0) { echo "socket_connect() failed.\nReason: ($result) " . socket_strerror($result) . "\n";} $Command = "..... data use to send to delphi......" socket_write ($socket, $Command, strlen ($Command)); //----------starting from this line where the error occur While($data == ""){ If (!($data = socket_read ($socket, 2048))) die("Socket disconnected by the host."); } echo $data; socket_close($socket); The code had no problem since it can be run on PHP 4.2.3, Win XP, mysqlThe example that does not depend on custom apps: $socket = socket_create (AF_INET, SOCK_STREAM, 0); if ($socket < 0) { echo "socket_create() failed: reason: " . socket_strerror ($socket) . "\n"; } $result = socket_connect ($socket, "www.google.com", 80); if ($result < 0) { echo "socket_connect() failed.\nReason: ($result) ". socket_strerror($result) . "\n";} $command = "HEAD / HTTP/1.0\r\n\r\n"; socket_write ($socket, $command, strlen($command)); while($data == ""){ if (!($data = socket_read ($socket, 2048))) die("Socket disconnected by the host."); } echo $data; socket_close($socket);