[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Cancel read on socket
- Date: Tue, 27 May 2008 15:47:42 +0200
- From: torsten.landschoff at nambition.com (Torsten Landschoff)
- Subject: Cancel read on socket
Leon Pollak wrote:
> Is there any way to cancel currently waiting read operation on UDP socket?
> I do not want to close it (need to use it immediately) or use select()
> (consumes a lot of CPU time).
>
Why does select() consume a lot of CPU time!? Wouldn't it be obvious to
fix select() then? Or poll for that matter...
AFAIK, the standard approach is to use a non-blocking socket, try a read
and only use select() if no data was available.
Sorry for not knowing a better/tested solution...
Torsten
--
Torsten Landschoff | Embedded software and FPGA development
nAmbition GmbH | Tatzberg 47, 01307 Dresden
| HRB NR. 23095 b. Amtsgericht Dresden
Gesch?ftsf?hrung | Dr. J. Struckmeier, F. Pelzer, Ren? M. Schretzmann