Release: serverino - please destroy it.

frame frame86 at live.com
Sun May 15 06:37:08 UTC 2022


On Saturday, 14 May 2022 at 23:23:47 UTC, Andrea Fontana wrote:

> Which kind of socket exception could be triggered by a client?
>
> Andrea

It doesn't matter if triggered by a client or not, you need to 
deal with the possibility. A closed/destroyed socket is an 
invalid resource.

I recently had the scenario on Windows where a client crashed and 
the socket wasn't closed properly somehow. Now the server adds 
the socket to the set to see an update - boom! "Socket operation 
on non-socket" error.

Also accepting sockets can throw, for eg. by a stupid network 
time out error - not only on Windows. Other socket operations are 
no exceptions either.

`isAlive` is fine for properly shutdowned/closed sockets by you 
or peer. But it doesn't protect you from faulting ones.


More information about the Digitalmars-d-announce mailing list