Post by Charlie Gibbs
Are you properly using listen() to listen for an incoming connection
and accept() to accept it?
Without a definition of "properly" there is no way I can answer that. But
if you are asking me if the code works than thats a "yes". Many other
connections work flawlessly, returning the expected data.
and handle it (as there is no connection I'm just closing the socket).
Post by Charlie Gibbs Post by R.Wieser
I've got a *very* simple setup which listens at a (port 80) socket, accepts
an incoming one and than reads from it.
The problem is that I somethimes (rather dependantly actually, using
Firefox) get a WSAENOTCONN error on the "recv" call (even though I (also)
checked for readability using "select" just before).
My question: what are the circumstances in which this error can pop up ?
Are you properly using listen() to listen for an incoming connection and
Post by R.Wieser
Also: how do I check for a non-connected socket (between accepting the
connection and) before calling a "recev" ? Checking a socket for
readability doesn't quite seem to work. :-(
Once you've properly established a connection, you should be good to go.
If the connection has subsequently been closed by the other end, recv()
will return zero.
Again, Beej's Guide to Network Programming is an excellent guide.
Start off with blocking calls and get it working that way first.
Non-blocking calls are a bit more complicated.
\ / I'm really at ac.dekanfrus if you read it the right way.
X Top-posted messages will probably be ignored. See RFC1855.
/ \ HTML will DEFINITELY be ignored. Join the ASCII ribbon campaig