Problems with select

Smith, Gene gene.smith at siemens.com
Mon Dec 6 23:38:11 UTC 2004


Camilo Alejandro Arboleda wrote, On 12/4/2004 12:34 PM:

> Chris Johns escribió:
> 
> 
>>Camilo Alejandro Arboleda wrote:
>>
>>
>>>I'm having trouble with select(). It returns -1, but the the 
>>>networking is working fine. What can cause select() to return -1?
>>>
>>>I don´t know if there are any generic reasons for that, or it depends 
>>>only on my code or both.
>>>
>>
>>Select can return -1 on an error and errno is set appropriately.
>>
>>What is errno set to ?
>>
> 
> It returns "Bad file number". Doing some debug i've found that the 
> problem is not in select. The situation is:
> 
> - I have two tasks, one for sending data and the other for receiving.
> - At some point the 'writing task' sends a packet, and then sends a 
> 'FIN-ACK' packet, without returning error, or close() being called.

I assume the partner host did not initiate the close with a FIN first?

> 
> Any idea?
> 
> 



More information about the users mailing list