8 #ifndef INCLUDE_WALLABY_SOCKET_HPP_ 9 #define INCLUDE_WALLABY_SOCKET_HPP_ 15 #include <netinet/in.h> 18 #define _WIN32_WINNT 0x0501 22 typedef u_long socklen_t;
34 Address(
const char *
const host,
const unsigned short port);
40 bool setHost(
const char *
const host);
41 void setPort(
const unsigned short port);
43 unsigned short port()
const;
45 const sockaddr *
addr()
const;
48 const char *
ip()
const;
60 bool open(
int domain,
int type,
int protocol);
62 bool setBlocking(
const bool blocking);
63 bool setReusable(
const bool reusable);
64 bool bind(
const unsigned short port);
70 ssize_t recv(
void *
const buffer,
const size_t length,
int flags = 0);
71 ssize_t recvfrom(
void *
const buffer,
const size_t length,
Address &address,
int flags = 0);
73 ssize_t send(
const void *
const buffer,
const size_t length,
int flags = 0);
74 ssize_t sendto(
const void *
const buffer,
const size_t length,
const Address &dest,
int flags = 0);
bool setHost(const char *const host)
int socket_fd_t
Definition: socket.hpp:27
unsigned short port() const
void fd(int motor)
Moves the given motor forward at full power.
Definition: socket.hpp:55
const sockaddr * addr() const
socklen_t addrLength() const
void setPort(const unsigned short port)
Definition: socket.hpp:31