|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-02-03 22:12 UTC] jani@php.net
[2009-02-04 19:00 UTC] bbarnett at gt dot co dot cr
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 20:00:01 2025 UTC |
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