mirror of
https://github.com/wiiu-env/gdbstub_plugin.git
synced 2024-06-26 01:36:08 +02:00
30 lines
434 B
C++
30 lines
434 B
C++
|
|
#pragma once
|
|
|
|
#include <cstddef>
|
|
|
|
class Socket {
|
|
public:
|
|
enum Type { TCP,
|
|
UDP };
|
|
|
|
Socket();
|
|
~Socket();
|
|
bool init(Type type);
|
|
bool close();
|
|
|
|
int sock;
|
|
};
|
|
|
|
class Client : public Socket {
|
|
public:
|
|
bool sendall(const void *data, size_t length);
|
|
bool recvall(void *data, size_t length);
|
|
};
|
|
|
|
class Server : public Socket {
|
|
public:
|
|
bool bind(int port);
|
|
bool accept(Client *client);
|
|
};
|