From: bbarnett at gt dot co dot cr Operating system: Windows 2003 Server R2 PHP version: 5.2.8 PHP Bug Type: Sockets related Bug description: I can not read the socket answer
Description: ------------ I'm trying to read the answer of a socket after I wrote the information that I must send before, but the application freeze and don't send me any message. I'm monitoring the port using TCPVIEWER and I can see while the conection is established. Using CLARION 6 I don't have any problem comunicating with the socket (writing and reading) my problem is only with PHP. I don't now if this is a bug, but after read many information about how to use the socket I'm giving up. Please, I need your help because we're developing a new software that comunicate with many socket's server to pay public services in my country and in actualy we are using Clarion 6, but with this environment we don't have enough support. Reproduce code: --------------- $puerto_servicio = 3260;$direccion = '172.25.10.5'; $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if ($socket === false) {echo "socket_create() falló: motivo: " . socket_strerror(socket_last_error()) . "<br>"; die(); } else {echo "OK.<br>";} $resultado = socket_connect($socket, $direccion, $puerto_servicio); if ($resultado === false) { echo "socket_connect() falló.<br>Motivo: ($resultado) " . socket_strerror(socket_last_error($socket)) . "<br>"; } else {echo "OK.<br>";} $entrada=$trama800; $salida = ''; if (!socket_write($socket, $entrada, strlen($entrada))) { echo "socket_connect() falló.<br>Motivo: ($resultado) " . socket_strerror(socket_last_error($socket)) . "<br>";} if (!$salida = socket_read($socket, 426)) { echo "socket_connect() falló en lectura.<br>Motivo: ($resultado) " . socket_strerror(socket_last_error($socket)) . "<br>";} socket_close($socket); Expected result: ---------------- I wait to recieve a string with 426 chars Actual result: -------------- frezze the browser -- Edit bug report at http://bugs.php.net/?id=47292&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47292&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47292&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47292&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=47292&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47292&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=47292&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=47292&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=47292&r=needscript Try newer version: http://bugs.php.net/fix.php?id=47292&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=47292&r=support Expected behavior: http://bugs.php.net/fix.php?id=47292&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=47292&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=47292&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=47292&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47292&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=47292&r=dst IIS Stability: http://bugs.php.net/fix.php?id=47292&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=47292&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=47292&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=47292&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=47292&r=mysqlcfg