SCTP stream socket read(2) can block a process

Bernd Walter ticso at cicely7.cicely.de
Tue Apr 15 23:55:21 UTC 2014


When using SCTP in TCP like stream style.
socket(2)
connect(2)
write(2) request
read(2) answer

When the other side disconnects the association (e.g. process restarted)
after the write and before read call the read never returns.
With TCP stream sockets the read would return with an error instead.
SCTP are not TCP, but the other side can't associate back in on such
a connect(2) socket, so returning would be expected.
I've switched to nonblocking with timeout in the meantime - I wanted
to have a response timeout anyway.
In my test case the other side was a one2many socket on the same host.

-- 
B.Walter <bernd at bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.


More information about the freebsd-net mailing list