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 Mon, 23 Dec 2019 09:58:58 +0000
Sad Clouds <cryintothebluesky%gmail.com@localhost> wrote:

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

I make a round-robin of connections that I may accept,
Say, of 1 or 5 thousands connections 

once one is valid I forget about the rest , since I only expect one


I guess I am realizing now that for me I have one singular point ,where the certificates are exchanged and verified, when I know the connection is valid.

Maybe your problem is different

I kindof pulled of nowhere the # of 1 to 5 thousand listening threads, as I actually haven't implemented that part on my project yet :p
(and I should, because now I have to wait until the rogue server tires for my thing to kick-in :))

But looking at my system, it says that:

>sysctl -a
...
kern.posix_threads = 200112

so it seems honnest.  You will only use all of the threads against a pack of rogue servers ;)

-- 
Germain Le Chapelain <germain.lechapelain%lanvaux.fr@localhost>
Software Engineer
Lanvaux



Home | Main Index | Thread Index | Old Index