3#include <EasySockets/Api/SocketTypes.hpp>
4#include <EasySockets/Api/Addresses.hpp>
5#include <EasySockets/Api/Documentation.hpp>
26 ES_API_DOC(socket_constructor)
44 ES_API_DOC(socket_bind_to)
53 ES_API_DOC(socket_connect_to)
60 ES_API_DOC(socket_listen_for_connections)
72 ES_API_DOC(socket_accept_connection)
81 ES_API_DOC(socket_receive_data)
91 ES_API_DOC(socket_receive_data_from)
103 ES_API_DOC(socket_send_data)
111 int64_t
send_data(
const char* buffer,
int buffer_size);
113 ES_API_DOC(socket_send_data_to)
134 addrinfo* resolve_address(
const EndPoint& end_point);
137 SocketData m_socket_data;
An object which represents a connection between two applications.
Definition PosixSocket.hpp:24
void listen_for_connections(int backlog)
Makes the socket start listening for incoming connections.
Definition PosixSocket.cpp:124
void connect_to(const EndPoint &end_point)
Connects a socket to the given end point.
Definition PosixSocket.cpp:104
PosixSocket(const PosixSocket &)=delete
PosixSocket accept_connection()
Accepts incoming connections.
Definition PosixSocket.cpp:130
PosixSocket & operator=(const PosixSocket &)=delete
void bind_to(const EndPoint &end_point)
Binds a socket to the given end point.
Definition PosixSocket.cpp:84
PosixSocket(IpVersion ip_version, Protocol protocol)
Constructor for Socket.
Definition PosixSocket.cpp:19
int64_t send_data_to(const char *buffer, int buffer_size, const EndPoint &end_point)
Sends data to the provided end point.
Definition PosixSocket.cpp:188
int64_t receive_data_from(char *buffer, int buffer_size, EndPoint &sender_end_point)
Waits to receive data from any endpoint.
Definition PosixSocket.cpp:153
int64_t send_data(const char *buffer, int buffer_size)
Sends data to the connected end point.
Definition PosixSocket.cpp:179
int64_t receive_data(char *buffer, int buffer_size)
Waits to receive data from the connected end point.
Definition PosixSocket.cpp:144
Definition Addresses.hpp:7
Represents the address + port that identifies a connection. Initialized by {Address,...
Definition Addresses.hpp:29