Reading data from a socket

Posted by Bobby on Stack Overflow See other posts from Stack Overflow or by Bobby
Published on 2010-04-29T19:04:01Z Indexed on 2010/04/29 19:07 UTC
Read the original article Hit count: 303

Filed under:
|
|

I am having issues reading data from a socket. Supposedly, there is a server socket that is waiting for clients to connect. When I write a client to connect() to the server socket/port, it appears that I am connected. But when I try to read() data that the server is supposedly writing on the socket, the read() function hangs until the server app is stopped.

Why would a read() call ever hang if the socket is connected? I believe that I am not ever really connected to the socket/port but I can't prove it, b/c the connect() call did not return an error. The read() call is not returning an error either, it is just never returning at all.

© Stack Overflow or respective owner

Related posts about c++

Related posts about socket