nfx icon indicating copy to clipboard operation
nfx copied to clipboard

Glue Native Sync listener hangs on Linux

Open itadapter opened this issue 6 years ago • 2 comments

Suspect that tcpServer.Accept is not broken by socket.close() on *nix platforms need to investigate

itadapter avatar Dec 14 '17 04:12 itadapter

I don't think this problem is .NET specific. On Linux the way to interrupt a blocking accept(3) without killing the thread that executes it is to send a signal to a process, in which case the accept() call would return EINTR (or whatever is the .NET equivalent code/exception). This is pretty ugly though. It would be much better to use the non-blocking socket to call accept() and use a reactive demultiplexer to poll for client connections.

saleyn avatar Jan 11 '18 02:01 saleyn

I have not researched where the freeze is as of yet. I suspect it is in the listener.accept with 90%+ confidence. But you are correct, about async listener, however keep in mind that this needs to be very simple solution, and secondarily, Glue does not need to handle very many accepts/sec so even the MPX binding is half synchronous which SIGNIFICANTLY simplifies it (no need to handle async accept etc..)

I am planning to get to this after Stabilization milestone

agnibos avatar Jan 11 '18 17:01 agnibos