NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ECONNRESET not returned when calling send() on a socket



On Sun, 22 Dec 2019 23:01:23 -0800
Germain Le Chapelain <germain%lanvaux.fr@localhost> wrote:

> I'm not saying poll() is wrong but it's more that from the other bits
> (different errors checking, sigpipe) , it felt to me like you are
> re-implementing TCP.

Not at all. I/O multiplexing with select()/poll()/epoll()/kqueue(),
etc. is a pretty standard way of handling multiple file descriptors.

Regardless of what you do, it will not change the behaviour of send()
syscall.

I'm curious, if you use two threads on a blocking socket, how do you
implement I/O timeout in order to prevent a rouge client from running
DoS attacks (read/write a few bytes of data, then go to sleep for a few
minutes) on platforms like Solaris, which may not support SO_RCVTIMEO
and SO_SNDTIMEO socket options?


Home | Main Index | Thread Index | Old Index