Messages in this thread | | | Date | Tue, 22 Jan 2002 13:47:10 -0800 (PST) | From | Melkor Ainur <> | Subject | tcp_recvmsg and tcp_data_wait with respect to select |
| |
Hello all,
I have been writing a TCP stack. In my implementation of tcp_recvmsg, I put the calling process to sleep around my device's waitqueue by doing a interruptible_sleep_on(&mywaitq); and then wake the caller on an interrupt.
This functionality works fine for an application that calls recv() and expects to block. However, an application like netcat/nc calls select on an input filehandle (stdin i think) as well as the recv() handle. When this is done, and I put the caller to sleep, recv works fine but the application is no longer woken out of select by standard input. This would suggest that the way I put the caller to sleep is different than the way linux's tcp_recvmsg does it. Looking at the code, I see tcp_data_wait which does approximately the same thing. I instrumented this area with some debug and noticed that when running netcat this is not what is called. I will continue to look for where tcp_recvmsg actually puts the caller to sleep. In the mean time, I am hoping for any hints/suggestions that could help me solve this issue.
Thanks, Melkor
__________________________________________________ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |