5#include <EasySockets/Api/SocketTypes.hpp>
6#include <EasySockets/Api/Addresses.hpp>
7#include <EasySockets/Api/Documentation.hpp>
27 ES_API_DOC(socket_default_constructor)
34 ES_API_DOC(socket_constructor)
52 ES_API_DOC(socket_bind_to)
61 ES_API_DOC(socket_connect_to)
68 ES_API_DOC(socket_listen_for_connections)
80 ES_API_DOC(socket_accept_connection)
89 ES_API_DOC(socket_receive_data)
99 ES_API_DOC(socket_receive_data_from)
111 ES_API_DOC(socket_send_data)
119 int64_t
send_data(
const char* buffer,
int buffer_size);
121 ES_API_DOC(socket_send_data_to)
132 ES_API_DOC(socket_close)
187 static addrinfo* resolve_address(
const WinsockData& winsock_data,
const EndPoint& end_point,
int flags);
190 WinsockData m_winsock_data;
static WindowsSocket make_bound_udp(Port port, IpVersion ip_version=IpVersion::DUAL_STACK)
Makes a UDP socket bound to the given port.
Definition WindowsSocket.cpp:317
int64_t receive_data(char *buffer, int buffer_size)
Waits to receive data from the connected end point.
Definition WindowsSocket.cpp:144
void close()
Closes the socket.
Definition WindowsSocket.cpp:217
static WindowsSocket make_connected_udp(const EndPoint &end_point)
Makes a UDP socket connected to the given endpoint.
Definition WindowsSocket.cpp:273
static WindowsSocket make_bound_tcp(Port port, IpVersion ip_version=IpVersion::DUAL_STACK)
Makes a TCP socket bound to the given port.
Definition WindowsSocket.cpp:303
WindowsSocket(const WindowsSocket &)=delete
WindowsSocket()
Default constructs a socket.
Definition WindowsSocket.cpp:10
int64_t receive_data_from(char *buffer, int buffer_size, EndPoint &sender_end_point)
Waits to receive data from any endpoint.
Definition WindowsSocket.cpp:154
static WindowsSocket make_connected_tcp(const EndPoint &end_point)
Makes a TCP socket connected to the given endpoint.
Definition WindowsSocket.cpp:243
void listen_for_connections(int backlog)
Makes the socket start listening for incoming connections.
Definition WindowsSocket.cpp:122
WindowsSocket & operator=(const WindowsSocket &)=delete
int64_t send_data(const char *buffer, int buffer_size)
Sends data to the connected end point.
Definition WindowsSocket.cpp:186
WindowsSocket accept_connection()
Accepts incoming connections.
Definition WindowsSocket.cpp:130
void connect_to(const EndPoint &end_point)
Connects a socket to the given end point.
Definition WindowsSocket.cpp:101
int64_t send_data_to(const char *buffer, int buffer_size, const EndPoint &end_point)
Sends data to the provided end point.
Definition WindowsSocket.cpp:196
void bind_to(const EndPoint &end_point)
Binds a socket to the given end point.
Definition WindowsSocket.cpp:80
Definition Addresses.hpp:7
Represents the address + port that identifies a connection. Initialized by {Address,...
Definition Addresses.hpp:29