Date: Wed, 16 Apr 2014 03:01:35 +0200 From: Bernd Walter <ticso@cicely7.cicely.de> To: FreeBSD-net@freebsd.org Cc: Bernd Walter <ticso@cicely7.cicely.de> Subject: Re: SCTP stream socket read(2) can block a process Message-ID: <20140416010135.GC32538@cicely7.cicely.de> In-Reply-To: <20140415235419.GG30429@cicely7.cicely.de> References: <20140415235419.GG30429@cicely7.cicely.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Apr 16, 2014 at 01:54:19AM +0200, Bernd Walter wrote: > 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. I wasn't correct - it happened to me after calling read(2), but before the other side send anything back, so the read(2) was already in kernel when the other side closed it's end. > 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. > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" -- 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?20140416010135.GC32538>