Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Apr 2014 01:54:19 +0200
From:      Bernd Walter <ticso@cicely7.cicely.de>
To:        FreeBSD-net@freebsd.org
Cc:        Bernd Walter <ticso@cicely7.cicely.de>
Subject:   SCTP stream socket read(2) can block a process
Message-ID:  <20140415235419.GG30429@cicely7.cicely.de>

next in thread | raw e-mail | index | archive | help
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@bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140415235419.GG30429>