9 Commits

Author SHA1 Message Date
Cloaked9000
657c8e21ad Mutex changes 2017-01-23 09:15:40 +00:00
Fred Nicolson
e0e956cf78 Socket::reconfigure_socket called on connection to apply options
'TCP_NODELAY' is set automatically on connection now.
2016-12-31 11:14:26 +00:00
Fred Nicolson
2a5d960e56 Added fr::Socket::has_data to check if recv buffer is empty
If using a SocketSelector, you should keep accepting data from the socket until has_data returns false, indicating that you've read everything.
2016-12-27 21:58:39 +00:00
Fred Nicolson
8638b70fb8 Thread safety for send/receive on both Tcp & SSL sockets
Send/Recv often needs to be called multiple times to transfer all of the data. send_raw/receive_raw are now mutex protected and so both send & receive can be called simultaneously.
2016-12-23 18:23:25 +00:00
Cloaked9000
70779fbe9c Added SocketReactor & fixes
Sockets will immediately return fr::Socket::Status::Disconnected if an attempt to send/receive data is made whilst the connection is closed.

Added SocketReactor, which is effectively a little wrapper around fr::SocketSelector, but can automatically call a callback for a socket when data is received on it.
2016-12-20 11:33:31 +00:00
Cloaked9000
2de9540819 Added windows support. Updated build system.
CMake build system builds as a library, not an executable now.

Windows is now supported and should work fine.
2016-12-19 12:10:39 +00:00
Cloaked9000
8c94c337e9 SSL Contexts are now shared between sockets 2016-12-16 14:55:41 +00:00
Cloaked9000
69d183ed18 Code refactoring 2016-12-15 14:57:01 +00:00
Cloaked9000
14fccb84c9 More work on SSL support.
You can now accept SSL connections using SSLListeners, and then send/receive data through the associated SSLSocket.

HttpSocket's now support both HTTP and HTTPS, using templates:

fr::HttpSocket<fr::SSLSocket> https_socket; 
fr::HttpSocket<fr::TcpSocket> http_socket;
2016-12-15 12:29:23 +00:00