problems re-reading from socket

From: Date: Fri, 24 Nov 2006 19:21:46 +0000
Subject: problems re-reading from socket
Groups: php.general 
Request: Send a blank email to php-general+get-245125@lists.php.net to get a copy of this message
I have a daemon class which reads and answers using socket_read and socket_write functions. The things is that I connect to the daemon, sent a chain and the I get an answer, but after that the daemon get's struck in the next socket_read. The problem appears to be here (a method from my class). I put the 2 echos for debugging purposses: function socketRead(){ echo "Vamos a leer nomas!\n"; $lectura = socket_read($this->conexion, 2048, PHP_NORMAL_READ); echo $lectura; return $lectura; } In th output from the socket daemon I get the 2 strings (generated by the 2 echos), after that I get again the first echo, but no matter how I try to send a new string to the socket, it just stays there reading from the socket. By the way $this->conexion is a socket resource from socket_accept. Also the socket reads and answers one time, so it is working, but after that first answer it stays reading. All this I'm testing from the console using a telnet to the socket. -- --------------------------------------------------------- Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática | '@' || 'unl.edu.ar'; Universidad Nacional | DBA, Programador, del Litoral | Administrador ---------------------------------------------------------

« previous php.general (#245125) next »