Cancel read on socket
Joel Sherrill
joel.sherrill at OARcorp.com
Sun May 25 09:32:57 UTC 2008
Sergei Organov wrote:
> Leon Pollak <leonp at plris.com> writes:
>
>
>> On Monday, 26 בMay 2008, Sergei Organov wrote:
>>
>>> shutdown()
>>>
>> I studied the internet again.
>> And again I am afraid that shutdown will not help - please, correct me if I am
>> wrong:
>> 1. shutdown seems not to cancel currently in progress "read" operation (which
>> blocked the task now).
>>
>
> Well, I'm not sure about UDP sockets, but for TCP sockets it should cancel
> read operation the same way as if remote end had closed connection, I
> believe. Though the socket won't be useful for reading after that anyway.
>
> Alternate approach to your problem could be to configure receive timeout
> for the socket, like this:
>
> setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &tv, len);
>
Without thinking about compatibility at all, shouldn't it be
possible to add an RTEMS specific IOCTL which forced
a read() to return an error like ECANCELED?
> -- Sergei.
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
More information about the users
mailing list