|
EasySockets v2.0.0
A simple, cross platform socket library for C++.
|
Classes | |
| struct | es::EndPoint |
Represents the address + port that identifies a connection. Initialized by {Address, Port}, e.g. {"192.168.0.1", 443}. More... | |
Typedefs | |
| using | es::Address = std::string |
| String IP address. | |
| using | es::Port = uint16_t |
| 16-bit port number. | |
| using | es::Socket = WindowsSocket |
| An object which represents a connection between two applications. | |
| using | es::Context = WinsockContext |
| An object which is required to exist for es::Sockets to be used. | |
Enumerations | |
| enum class | es::IpVersion { es::IpVersion::IPV4 , es::IpVersion::IPV6 , es::IpVersion::DUAL_STACK } |
| Version of IP address. More... | |
| enum class | es::Protocol { es::Protocol::TCP , es::Protocol::UDP } |
| Layer 4/transport layer protocol. More... | |
| using es::Address = std::string |
String IP address.
| using es::Context = WinsockContext |
An object which is required to exist for es::Sockets to be used.
This ensures that any underlying setup and cleanup code is called.
For example:
es::Context context{}; // must be created before any sockets are created
es::Socket socket{es::IpVersion::ipv4, es::Protocol::tcp};
socket.bind({"0.0.0.0", 8080});
Can be moved from but not copied. Members are the same across all implementations.
| using es::Port = uint16_t |
16-bit port number.
| using es::Socket = WindowsSocket |
An object which represents a connection between two applications.
On creation, type of ip addresses that the socket will use and the layer 4/transport layer protocol is specified.
From this, methods like .bind_to(EndPoint end_point) and .connect_to(EndPoint end_point) to give the socket an address and port so that it can start communicating with other applications.
For connectionless protocols like UDP, data can be sent and received without binding or connecting first.
Can be moved from but not copied. Members are the same across all implementations.
|
strong |
|
strong |