25 #ifndef SFML_SOCKETTCP_HPP
26 #define SFML_SOCKETTCP_HPP
31 #include <SFML/Network/SocketHelper.hpp>
39 template <
typename>
class Selector;
62 void SetBlocking(
bool Blocking);
74 Socket::Status Connect(
unsigned short Port,
const IPAddress& HostAddress,
float Timeout = 0.f);
84 bool Listen(
unsigned short Port);
107 Socket::Status Send(
const char* Data, std::size_t Size);
120 Socket::Status Receive(
char* Data, std::size_t MaxSize, std::size_t& SizeReceived);
130 Socket::Status Send(
Packet& PacketToSend);
141 Socket::Status Receive(
Packet& PacketToReceive);
158 bool IsValid()
const;
168 bool operator ==(
const SocketTCP& Other)
const;
178 bool operator !=(
const SocketTCP& Other)
const;
190 bool operator <(
const SocketTCP& Other)
const;
203 SocketTCP(SocketHelper::SocketType Descriptor);
211 void Create(SocketHelper::SocketType Descriptor = 0);
216 SocketHelper::SocketType mySocket;
217 Uint32 myPendingHeader;
218 Uint32 myPendingHeaderSize;
219 std::vector<char> myPendingPacket;
220 Int32 myPendingPacketSize;
227 #endif // SFML_SOCKETTCP_HPP