25 #ifndef SFML_TCPSOCKET_HPP
26 #define SFML_TCPSOCKET_HPP
31 #include <SFML/Network/Export.hpp>
32 #include <SFML/Network/Socket.hpp>
33 #include <SFML/System/Time.hpp>
157 Status send(
const void* data, std::size_t size, std::size_t& sent);
224 std::size_t SizeReceived;
225 std::vector<char> Data;
231 PendingPacket m_pendingPacket;
237 #endif // SFML_TCPSOCKET_HPP
IpAddress getRemoteAddress() const
Get the address of the connected peer.
Status receive(Packet &packet)
Receive a formatted packet of data from the remote peer.
Socket that listens to new TCP connections.
Status send(const void *data, std::size_t size, std::size_t &sent)
Send raw data to the remote peer.
Encapsulate an IPv4 network address.
Status receive(void *data, std::size_t size, std::size_t &received)
Receive raw data from the remote peer.
TcpSocket()
Default constructor.
unsigned short getLocalPort() const
Get the port to which the socket is bound locally.
Status
Status codes that may be returned by socket functions.
Utility class to build blocks of data to transfer over the network.
static const Time Zero
Predefined "zero" time value.
Status connect(const IpAddress &remoteAddress, unsigned short remotePort, Time timeout=Time::Zero)
Connect the socket to a remote peer.
Specialized socket using the TCP protocol.
void disconnect()
Disconnect the socket from its remote peer.
Base class for all the socket types.
unsigned short getRemotePort() const
Get the port of the connected peer to which the socket is connected.
Status send(const void *data, std::size_t size)
Send raw data to the remote peer.
Status send(Packet &packet)
Send a formatted packet of data to the remote peer.