Moving these headers from src to include enables other libraries to use the
functionality provided.
* tcpsockets
* atomic_static
* raw_istream
* timestamp
* SafeThread
* Base64
* LEB128
* ConcurrentQueue
The classes have been moved into the wpi namespace as they're generic.
The previous use of a timeout resulting in thread detach instead of thread
join resulted in a race condition on Mac between destruction and thread
closeout. This commit removes the detach functionality and uses dup2() to
on Linux/Mac and connecting to itself on Windows to try to ensure accept()
exits.
This is safe because of the way writes are performed: for each transmission,
all outgoing messages are concatenated in memory and only a single write()
syscall is made.
Windows returns WSAEWOULDBLOCK on a connect() attempt on a nonblocking socket.
Also wrap socket error handling so errors are correctly reported on Windows.
Fixes#19.