25#ifndef SFML_SOCKET_HPP
26#define SFML_SOCKET_HPP
31#include <SFML/Network/Export.hpp>
32#include <SFML/Network/SocketHandle.hpp>
33#include <SFML/System/NonCopyable.hpp>
171 friend class SocketSelector;
177 SocketHandle m_socket;
NonCopyable()
Default constructor.
Multiplexer that allows to read from multiple sockets.
void setBlocking(bool blocking)
Set the blocking state of the socket.
@ AnyPort
Special value that tells the system to pick any available port.
Status
Status codes that may be returned by socket functions.
@ Partial
The socket sent a part of the data.
@ Error
An unexpected error happened.
@ Done
The socket has sent / received the data.
@ NotReady
The socket is not ready to send / receive data yet.
@ Disconnected
The TCP socket has been disconnected.
Type
Types of protocols that the socket can use.
SocketHandle getHandle() const
Return the internal handle of the socket.
void close()
Close the socket gracefully.
virtual ~Socket()
Destructor.
Socket(Type type)
Default constructor.
void create()
Create the internal representation of the socket.
bool isBlocking() const
Tell whether the socket is in blocking or non-blocking mode.
void create(SocketHandle handle)
Create the internal representation of the socket from a socket handle.