Preventing write into a socket before the other side accepted the request

Posted by EpsilonVector on Stack Overflow See other posts from Stack Overflow or by EpsilonVector
Published on 2010-06-15T16:51:00Z Indexed on 2010/06/15 16:52 UTC
Read the original article Hit count: 196

Filed under:
|
|

I'm implementing an FTP like protocol in Linux (homework) and I came upon the following problem: the client may be able to connect() and write() before the other side managed to do accept() (but after it did listen()). How can I prevent the write operation from working without relying on passing messages like "accept succeeded, you can write now" in a different communication channel?

© Stack Overflow or respective owner

Related posts about linux

Related posts about networking