tags:

views:

42

answers:

3

under what conditions a socket is ready for reading and writing?

A: 

After the socket binds to a IP address and port, its ready to read/write. Is your question specific for any language ?

lava
A: 

On a server, you would usually do in order:

So, in this situation, your socket would be ready for reading and writing after passing and on successful accept()

On a client side:

So here, it would be ready if it passes and on successfull connect().

ccheneson
A: 

Have a look at the excellent Beej's guide to network programming here. Worthy read...

tommieb75