Subject: |
Re: socket shutdown races? |
From: |
Michael Davidsaver via Core-talk <[email protected]> |
To: |
EPICS core-talk <[email protected]> |
Date: |
Tue, 9 Jul 2019 16:50:47 -0700 |
On 7/8/19 8:05 PM, Michael Davidsaver wrote:
> Sorry for the stream of consciousness (aka ramble). I've been digging into
> this all day. I thought I'd see if anyone else has run across
> this situation before.
part 2?
I did an experiment on interrupting recvfrom() on a UDP socket.
Also accept() or recv() with a TCP socket. Used travis-ci VM for Linux
and OSX. Appveyor VM for windows.
TCP recv()
Linux - shutdown(SHUT_RDWR) returns 0 and interrupts. recv() returns 0.
OSX - same as Linux
Windows - shutdown(SHUT_RDWR) returns 0 and interrupts! recv() returns WinError 10038 (not a socket)
So for the case which really matters, shutdown() appears to work on all three. (also RTEMS and presumably vxworks)
bye bye epicsSocketSystemCallInterruptMechanismQuery() ?
TCP accept()
Linux - shutdown(SHUT_RDWR) returns 0 and interrupts. accept() returns EINVAL
OSX - shutdown() errors and does not interrupt. close() interrupts. accept() returns EBADR
Windows - shutdown() errors and does not interrupt. close() interrupts. accept() returns WinError 10038 (not a socket)
UDP recvfrom()
Linux - shutdown(SHUT_RDWR) returns 0 and interrupts. recvfrom() returns 0 (ambiguous w/ valid UDP zero length packet)
OSX - shutdown() errors and does not interrupt. close() interrupts, and recvfrom() returns EBADF
Windows - shutdown() succeeds and interrupts. recvfrom() returns WinError 10022 (invalid argument)
- References:
- socket shutdown races? Michael Davidsaver via Core-talk
- Navigate by Date:
- Prev:
Re: [Merge] ~epics-core/epics-base/+git/Com:make-simple into epics-base:7.0 Andrew Johnson via Core-talk
- Next:
Re: [Merge] ~epics-core/epics-base/+git/Com:make-simple into epics-base:7.0 mdavidsaver via Core-talk
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
<2019>
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
socket shutdown races? Michael Davidsaver via Core-talk
- Next:
Build failed: epics-base base-integration-267 AppVeyor via Core-talk
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
<2019>
2020
2021
2022
2023
2024
|