Re: Q about low lvl UNIX socket programming

From: kuznet@ms2.inr.ac.ru
Date: Fri Apr 28 2000 - 09:34:19 EST


Hello!

> Ive solved it by using TIOCOUTQ to check how much is free in the sending
> buffer.

TIOCOUTQ is undefined for sockets. "T" stands for terminal
and it returns amount of data _queued_ in tty, rather than available
for write. TIOCINQ is undefined for sockets as well, but it is alias
for FIONREAD.

Blocking sockets make no guarantees about blocking when
writing more than one byte and always may do partial writes.
Use non-blocking IO, if you do not want to block.

Alexey

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 30 2000 - 21:00:15 EST