Debugger stuff. Lots of wasted work :/

This commit is contained in:
Ben Vanik
2015-07-26 22:47:03 -07:00
parent 42ef3f224a
commit 7ecc6362de
52 changed files with 3476 additions and 172 deletions

View File

@@ -28,7 +28,8 @@ namespace xe {
// wait handle should be waited on until new data arrives.
class Socket {
public:
// TODO(benvanik): client socket static Connect method.
// Synchronously connects to the given hostname:port.
static std::unique_ptr<Socket> Connect(std::string hostname, uint16_t port);
virtual ~Socket() = default;
@@ -84,6 +85,12 @@ class Socket {
auto buffer_list = std::make_pair(buffer.data(), buffer.size());
return Send(&buffer_list, 1);
}
// Asynchronously sends a string buffer.
// Returns false if the socket is disconnected or the data cannot be sent.
bool Send(const std::string& value) {
return Send(value.data(), value.size());
}
};
// Runs a socket server on the specified local port.