147 [[nodiscard]]
Status send(
const void* data, std::size_t size);
163 [[nodiscard]]
Status send(
const void* data, std::size_t size, std::size_t& sent);
181 [[nodiscard]]
Status receive(
void* data, std::size_t size, std::size_t& received);
226 std::uint32_t size{};
227 std::size_t sizeReceived{};
228 std::vector<std::byte> data;
234 PendingPacket m_pendingPacket;
235 std::vector<std::byte> m_blockToSendBuffer;
#define SFML_NETWORK_API
Definition Export.hpp:42
Encapsulate an IPv4 network address.
Definition IpAddress.hpp:49
Utility class to build blocks of data to transfer over the network.
Definition Packet.hpp:49
Status
Status codes that may be returned by socket functions.
Definition Socket.hpp:49
Socket(const Socket &)=delete
Deleted copy constructor.
Socket that listens to new TCP connections.
Definition TcpListener.hpp:45
Status send(Packet &packet)
Send a formatted packet of data to the remote peer.
friend class TcpListener
Definition TcpSocket.hpp:218
Status send(const void *data, std::size_t size, std::size_t &sent)
Send raw data to the remote peer.
std::optional< IpAddress > getRemoteAddress() const
Get the address of the connected peer.
Status connect(IpAddress remoteAddress, unsigned short remotePort, Time timeout=Time::Zero)
Connect the socket to a remote peer.
TcpSocket()
Default constructor.
Status receive(void *data, std::size_t size, std::size_t &received)
Receive raw data from the remote peer.
unsigned short getRemotePort() const
Get the port of the connected peer to which the socket is connected.
unsigned short getLocalPort() const
Get the port to which the socket is bound locally.
Status receive(Packet &packet)
Receive a formatted packet of data from the remote peer.
void disconnect()
Disconnect the socket from its remote peer.
Status send(const void *data, std::size_t size)
Send raw data to the remote peer.
Represents a time value.
Definition Time.hpp:42
static const Time Zero
Predefined "zero" time value.
Definition Time.hpp:110
Definition BlendMode.hpp:34