Re: reading socket with timeout?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Luben Tuikov wrote:
> 
> Does anyone know a good way of reading from a
> socket BUT timing out by a specified timeout
> (from a kernel thread of course).
> 
> I tried setting up sk->recvtimeo and/or using
> my own version of tcp_data_wait() but it is still
> quite slow (as opposed to polling in which case
> the the data transfer is _very_ fast!)

That is, I'd like to sleepy read from the socket
and return as soon as the first byte gets there
or as soon as it timesout. (then I can read the data
in a more intelligent way)

Thanks,
-- 
Luben
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux