Select() call behaviour

Discussion in 'Win32' started by Amit, Sep 20, 2006.

  1. Amit

    Amit New Member

    Sep 20, 2006
    Likes Received:
    Trophy Points:
    Hi All,

    I am working on a protocol development which involves use of TCP as transport protocol. In this I am creating two task(threads) one for reading and other for sending the data to the same socket( I am using the non-blocing socket) . In read task I am adding the sock fd to the readfd set and calling select only over the readfd set(Write and Exception fd set are null). Select gets bolcked and waits for some operation to occur on readfd set. But if at the same time if I try to send data from the send task (while read task is waiting over select) it is getting blocked within the send() call of send task.

    Can anybody tell me why this is happening?

    when i am adding the writefd set in the select call that time select becomes non block and returing over the writefd set even when I am not sending any data form send task.

    Thanks in Advance.


Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice