3 Commits

Author SHA1 Message Date
Ben Clayton
5f3169421e
Fix reconnection of sockets (#70)
This was entirely broken:
* The `Server` `Impl` used a `do{}while(false)` block, which never attempted to accept another connection after the first connection closed (#69)
* The `Server` `Impl` could deadlock with the mutex being locked by both the thread calling `isRunning()` and `stopWithLock()` waiting on `thread.join()`.
* `Socket::accept()` didn't check that the returned socket was valid, and could return a `ReaderWriter` that would just error on IO.
* `Socket::accept()` could deadlock on macOS as `shutdown()` can seemingly fail to unblock an accept call. This has been worked around by calling `close()` outside of the mutex write-lock. This introduces a potential race, but I'm not sure of a better solution right now.
 
Fixes: #69
2021-09-07 18:55:02 +01:00
Ben Clayton
3a10d4cabd Format all source files 2020-01-06 15:00:24 +00:00
Ben Clayton
2dfd15462f Initial drop of cppdap 2019-11-08 21:58:50 +00:00