Greetings!
I'am developing the single thread http
server
which uses kqueue/kevent for both
sockets
and async file reads. It works just fine and
I thought
I 'd be able to do all the stuff with one
thread until it
comes to proper socket closing.
As far as I understand the only way for
server, working
with HTTP/1.0 client, to mark the data end is
to close the
connection when the response was done.
According to the
interface this does't mean that all the
packets will arrive to the
client so one should set the socket option to
SO_LINGER
and then call close() to be sure that all the packets are acknowledged
before closing the connection and make the OS handle the connection close. The problem is, according to some posts, many
systems
block the process on close() or shutdown()
_when_ SO_LINGER is used.
My question is: Does it safe to
SO_LINGER with close() or shutdown() in FreeBSD 4.1+?
Will they block or not?
Thanks for all replies,
Dmitry
|