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.
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).
Socket mutexes are no longer really required, and so have been removed.
Added more tests for network encoding functions, and the URL parser.
The URL parser now returns a path preceeded with a '/' instead of cutting it out. Added get_uri() to URL, for getting the whole URI, so users don't have to concat it themselves from the more specialised functions.
Fixed default socket connect timeout checking for the wrong value.
Fixed request_type_strings not containing all of the possible request types.
Fixed README using old socket close syntax.
Cleaned up the examples a bit.
Fixed HTTP request parse failing if the URI was too short.
Fixed HTTP parser not converting POST/GET data to lowercase before storing it, making post and get data which contained capitals impossible to access.
Both fr::TcpSocket and fr::SSLSocket can have timeouts specified when connecting. This works by putting the socket into non-blocking mode, making a connect, and then selecting on the socket for the requested timeout. If the select times out then we've failed to connect, if it didn't time out then we've connected.
Recv's return value was being checked to see if it was greater or equal to 0, if everything was okay. 0 indicates connection closed, and so the socket should have disconnected instead of returning Success.
fr::TcpSocket checked if the recv response was greater than 0, which created issues as 0 is a valid result if no data was received and no error occurred.
fr::HttpResponse::construct() now adds in a content-length header.
fr::HttpResponse::parse trims the body if it's larger than content length.
fr::Http::set_uri() now prepends a '/' if one's not provided.
Fixed fr::Http::parse_header from cutting off the end of headers.
Build errors have been fixed, but there are build warnings remaining about unsafe conversions, because Visual C++'s network conversion functions have a differing return type to mine. To be fixed in the future.
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.
SocketReactor actually calls callbacks.
receive_all no longer tries to access out of bound array indexes.
fr::Packet constructor can now take as many arguments as you like and they'll be added to it automatically.
Added bool fr::Packet<< operator overload.
Added 'HttpSocket', which inherits TcpSocket and adds a receive and send functions for WebRequest objects.
WebRequest objects can be used to parse, construct and extract HTTP requests. They can be sent through HttpSocket's.
Can now send and receive raw data over TcpSockets for communicating with other protocols, such as HTTP.
Fixed TcpSocket::close only calling close() if the connection isn't open (gg wp)