Nazara Engine
0.4
A fast, complete, cross-platform API designed for game development
|
Network class that represents a server in a TCP connection. More...
Public Member Functions | |
TcpServer () | |
Constructs a TcpServer object by default. | |
TcpServer (TcpServer &&tcpServer) | |
Constructs a TcpServer object with another one by move semantic. More... | |
bool | AcceptClient (TcpClient *newClient) |
Accepts a client. More... | |
IpAddress | GetBoundAddress () const |
Gets the bound address. More... | |
UInt16 | GetBoundPort () const |
Gets the port of the bound address. More... | |
SocketState | Listen (NetProtocol protocol, UInt16 port, unsigned int queueSize=10) |
Listens to a socket. More... | |
SocketState | Listen (const IpAddress &address, unsigned int queueSize=10) |
Listens to a socket. More... | |
Public Member Functions inherited from Nz::AbstractSocket | |
AbstractSocket (const AbstractSocket &)=delete | |
AbstractSocket (AbstractSocket &&abstractSocket) | |
Constructs a AbstractSocket object with another one by move semantic. More... | |
virtual | ~AbstractSocket () |
Destructs the object and calls Close. More... | |
void | Close () |
Closes the socket. | |
void | EnableBlocking (bool blocking) |
Enables blocking. More... | |
SocketError | GetLastError () const |
Gets the last error. More... | |
SocketHandle | GetNativeHandle () const |
Gets the internal socket handle. More... | |
SocketState | GetState () const |
Gets the internal state. More... | |
SocketType | GetType () const |
Gets the internal type. More... | |
bool | IsBlockingEnabled () const |
Checks whether the blocking is enabled. More... | |
std::size_t | QueryAvailableBytes () const |
Queries the available bytes. More... | |
std::size_t | QueryReceiveBufferSize () const |
Queries the maximum socket receive buffer size. More... | |
std::size_t | QuerySendBufferSize () const |
Queries the maximum socket send buffer size. More... | |
void | SetReceiveBufferSize (std::size_t size) |
Sets the maximum receive buffer size. More... | |
void | SetSendBufferSize (std::size_t size) |
Sets the maximum send buffer size. More... | |
AbstractSocket & | operator= (const AbstractSocket &)=delete |
AbstractSocket & | operator= (AbstractSocket &&abstractSocket) |
Moves the AbstractSocket into this. More... | |
NazaraSignal (OnStateChange, const AbstractSocket *, SocketState) | |
Additional Inherited Members | |
Protected Member Functions inherited from Nz::AbstractSocket | |
AbstractSocket (SocketType type) | |
Constructs a AbstractSocket object with a type. | |
bool | Open (NetProtocol protocol) |
Opens the socket according to a net protocol. More... | |
void | Open (SocketHandle existingHandle) |
Opens the socket according to a socket handle. More... | |
void | UpdateState (SocketState newState) |
Updates the state of the socket. More... | |
Protected Attributes inherited from Nz::AbstractSocket | |
NetProtocol | m_protocol |
SocketError | m_lastError |
SocketHandle | m_handle |
SocketState | m_state |
SocketType | m_type |
bool | m_isBlockingEnabled |
Network class that represents a server in a TCP connection.
|
inline |
bool Nz::TcpServer::AcceptClient | ( | TcpClient * | newClient | ) |
Accepts a client.
newClient | Client connection |
|
inline |
Gets the bound address.
|
inline |
Gets the port of the bound address.
|
inline |
Listens to a socket.
protocol | Net protocol to listen to |
port | Port to listen to |
queueSize | Size of the queue |
SocketState Nz::TcpServer::Listen | ( | const IpAddress & | address, |
unsigned int | queueSize = 10 |
||
) |
Listens to a socket.
address | Address to listen to |
queueSize | Size of the queue |