Socket

Open a socket and send data.

Example

#include <r8/core/socket.h>
using namespace R8;
Core::Socket socket(Core::Socket::Domain::Inet, Core::Socket::Type::Tcp);
if (socket.connect(Core::Uri("http://127.0.0.1:8666")) == 0) {
   char response[256] = { 0 };
   socket.send("Hello!", 6, response, sizeof(response));
   LogInfo("%s", response);
}

You may try this example out by using netcat to setup a simple server.

$ nc --listen --local-port=8666