how to block a socket indefinitely

Hi everybody,

When a socket is created, by default it is a blocking socket. Under blocking mode socket I/O operations, connect and accept operations all block until the operation in question is completed.
I want to receive data periodically from a client. That is, the first time I receive data the socket is blocked in the accept function but the next time is not blocked anymore and I want that it waits for the next incoming data. I use the ioctlsocket function after the accept function but it doesn't work.

Can you help me?

thank you very much.
Didn't you just ask this previously? Why do you think the socket's no longer blocked. It doesn't just change to be non-blociked on its own.
you taking it wrong, after accepting the connection you dont have to anything with accept.
you will be blocked at recv till you didnt get next piece of data.
Hi averybody,

My program receives the first block of data and afterwards it doesn´t wait anymore for other data on the accept function. I tried it but it doesn't work and I don't understand why it won't be blocked again.
I have a server application who must attend to an iterative client that send data periodically.

How can I do that?
Topic archived. No new replies allowed.