May 12, 2022

On Thursday, 12 May 2022 at 11:33:07 UTC, Andrea Fontana wrote:

>

Does dmd/rdmd work? Serverino uses std.net.curl just for running its unittests, so maybe that bug is not blocking.

Well tbh, the simple fact that I would have to use WSL is a blocker for me.
AFAIK vibe or cgi.d do not require that.

May 12, 2022

On Thursday, 12 May 2022 at 11:46:05 UTC, Guillaume Piolat wrote:

>

On Thursday, 12 May 2022 at 11:33:07 UTC, Andrea Fontana wrote:

>

Does dmd/rdmd work? Serverino uses std.net.curl just for running its unittests, so maybe that bug is not blocking.

Well tbh, the simple fact that I would have to use WSL is a blocker for me.
AFAIK vibe or cgi.d do not require that.

Yay. I need a Windows machine (or someone with it!) to rewrite some POSIX parts.

For example the part that send/receive the file descriptor (of a socket) from the master process to the worker (windows has its own API for this)

May 14, 2022

On Sunday, 8 May 2022 at 21:32:42 UTC, Andrea Fontana wrote:

>

Please help me testing it, I'm looking forward to receiving your shiny new issues on github.

Dub package: https://code.dlang.org/packages/serverino

Andrea

Take care of socket exceptions - especially if you want to make a port to Windows.

You should always expect one. It's not enough to test Socket.isAlive - a client socket may be faulty and any illegal socket operation throws and kills your loop. Even if isAlive works as expected, it may changes the status before you have add the socket to the set. You don't want your server to crash if a client misbehaves.

May 14, 2022

On Saturday, 14 May 2022 at 20:44:54 UTC, frame wrote:

>

Take care of socket exceptions - especially if you want to make a port to Windows.

You should always expect one. It's not enough to test Socket.isAlive - a client socket may be faulty and any illegal socket operation throws and kills your loop. Even if isAlive works as expected, it may changes the status before you have add the socket to the set. You don't want your server to crash if a client misbehaves.

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

Andrea

May 15, 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.

May 15, 2022

On Sunday, 15 May 2022 at 06:37:08 UTC, frame wrote:

>

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.

Ok, added some checks on .select, .accept, .bind, .listen.
Thank you.

Andrea

1 2 3 4 5 6
Next ›   Last »