Felip Alàez Nadal | 26 Aug 17:49

Something strange with read on sockets. Help needed

Hello:

I'm in trouble with sockets. I've created a little multithreaded server class which I plan to use for games. I have problems reading from sockets. I create the server and, when It makes an accept(), returns an Stdio.File object which represents the socket, don't? Then the server can write to the socket. I know that the server works because I can do a telnet and connect to It. My problem is that I can't read anything from the socket. If I do mySocket->read(), It never returns. I write on the telnet terminal and the server never returns from the call to mySocket->read(). I also wrote a little telnet program in pike and I have the same problem: the server writes to the telnet program, but can't read anything from It.

Can somebody explain me which is the correct way to read data from a socket?

Thanks you.

--
Felip Alàez Nadal

Gmane