Re: Xt Interface?

Arnt Gulbrandsen (
25 Feb 1997 22:30:48 +0100

To subscribers of the xforms list from Arnt Gulbrandsen <> : (Steve Lamont)
> In practice, you probably don't need to even register a FL_WRITE
> condition. Just register the FL_READ condition and service the socket
> for reading. You can generally just write to the socket with impunity
> -- I've never had a problem with a write() call blocking for any
> significant time.

write() can block now and then if the send window is small enough
compared to the amount you're writing and you have a little bad luck
with the network. The send window almost always defaults to 4k or
more, often to 16k or more, and you can increase it using something

fodder = 49152; /* don't increase this beyond 50k */
if ( setsockopt( fd, SOL_SOCKET, SO_SNDBUF,
(char *)&fodder, sizeof(int) ) < 0 )
syslog( LOG_WARNING, "setsockopt( SO_SNDBUF, %d ): %m", window );

If you expect to write more than about 1k in one go, I advise you to
register and unregister that yucky callback, so your software will be
responsive even when the network is behaving badly.

To unsubscribe, send the message "unsubscribe" to or see
Xforms Home Page:
List Archive: