Re: Q about low lvl UNIX socket programming

From: Jerry Lundström (jerry.lundstrom@citat.se)
Date: Fri Apr 28 2000 - 10:08:02 EST


On Fri, 28 Apr 2000 18:34:19 +0400 (MSK DST), kuznet@ms2.inr.ac.ru wrote:

>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.
>

Hmm, didn't know this, thanks.

>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.
>

Blocking or non-blocking, the write will still split it.

--
Jerry.Lundström:<jerry.lundstrom@citat.se>:system.developer/programmer
icq.18682823:mobile+46.739.876053:phone+46.31.7107244:fax+46.31.7107201
citat.solutions:Kronhusgatan.9:SE-411.05.Gothenburg:Sweden
www.citat.se/solutions

- 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