Fixed some sign comparison warnings.
Added utility functions to fr::Packet's for:
Getting read cursor position.
Relative read cursor seeking.
Asserting that data remains in the packet
Getting the amount of data remaining
Getting the size of the packet
Recv timeouts can now be specified for sockets, which is the maximum amount of time to wait before returning during a receive. They will return WouldBlock if no data was received during the wait time.
Receiving a HTTP request in non-blocking mode will no longer fail.
Added missing move/copy constructor deletors to SSLSocket, to prevent the object from becoming invalid.
Removed noexcept specifier from some constructors where valid exceptions can be thrown.
Exceptions are now thrown from the SSLSocket constructor if it fails to initialise properly, rather than printing something out to stderr and continuing.
The socket is put into non-blocking mode prior to connecting. Previously, errno was being checked after connecting to see if the socket would block. This is the correct behaviour on Linux. On Windows however, errno remains 0, and WSAGetLastError() needs to be compared against WSAEWOULDBLOCK instead.
Replaced instances of resize&memcpy with append, which gives a noticeable performance boost.
fr::Packet::operator<<(const char *str) no longer converts str into an std::string before adding it, removing an unneeded copy.
fr::Packet::clear no longer calls erase, should result in more of the internal buffer remaining allocated.
Framing for std::vector's has been changed from a uint64_t to a uint32_t (breaking change for packet framing!)
Previously, fr::Packet would use 'size_t' for dealing with vector sizes. This is not ideal though, as the size of size_t is platform depenant, meaning that fr::Packet's sent on one computer might be incompatible with other systems.
Added Sha1 hash, and Base64 encode implementations which are optionally compiled if websock support is enabled, to assist in the WebSock handshake.
Added WebSocket to manage the WebSock protocol during connections.
Added WebFrame to allow for sending/receiving data through the WebSock protocol easily.
Fixed TcpSocket::set_descriptor(nullptr) causing an invalid read from address 0x0.
Improved HTTP response/request parsing so that they report a parse failure if the first few bytes of the HTTP request don't match the expected format rather than continuing to look for an end of header.
Fixed broken fr::Http::url_encode() implementation.
Optimised fr::Http::url_decode() implementation.
Added fr::Http unit tests.
Fixed SSLListener failing to accept SSLSockets properly (not setting the descriptor properly).
TcpSocket::receive_raw and SSLSocket::receive_raw now behave the same, rather than SSLSocket acting more like Socket::receive_all.
Documented specific return values from Socket::receive_all().
Socket::receive_all now returns WouldBlock if the socket is in blocking mode and the first read returns no data, so it doesn't behave like a blocking socket.
Disabled copying/moving of sockets. Copying shouldn't have been enabled, but might add move constructors in the future.
Added Socket::disconnect, which internally just calls close_socket, to allow for protocol-specific disconnect sequences in the future (WebSockets).