Select() call behaviour

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

  1. Amit

    Amit New Member

    Joined:
    Sep 20, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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.

    Regards,
    Amit
     

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