Network class that represents the base of socket.
More...
|
| AbstractSocket (SocketType type) |
| Constructs a AbstractSocket object with a type.
|
|
virtual void | OnClose () |
| Operation to do when closing socket.
|
|
virtual void | OnOpened () |
| Operation to do when opening socket. More...
|
|
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...
|
|
|
NetProtocol | m_protocol |
|
SocketError | m_lastError |
|
SocketHandle | m_handle |
|
SocketState | m_state |
|
SocketType | m_type |
|
bool | m_isBlockingEnabled |
|
Network class that represents the base of socket.
◆ AbstractSocket()
Nz::AbstractSocket::AbstractSocket |
( |
AbstractSocket && |
abstractSocket | ) |
|
Constructs a AbstractSocket object with another one by move semantic.
- Parameters
-
◆ ~AbstractSocket()
Nz::AbstractSocket::~AbstractSocket |
( |
| ) |
|
|
virtual |
Destructs the object and calls Close.
- See also
- Close
◆ EnableBlocking()
void Nz::AbstractSocket::EnableBlocking |
( |
bool |
blocking | ) |
|
Enables blocking.
- Parameters
-
blocking | Should the read block |
◆ GetLastError()
SocketError Nz::AbstractSocket::GetLastError |
( |
| ) |
const |
|
inline |
Gets the last error.
- Returns
- Socket error
◆ GetNativeHandle()
SocketHandle Nz::AbstractSocket::GetNativeHandle |
( |
| ) |
const |
|
inline |
Gets the internal socket handle.
- Returns
- Socket handle
◆ GetState()
SocketState Nz::AbstractSocket::GetState |
( |
| ) |
const |
|
inline |
Gets the internal state.
- Returns
- Socket state
◆ GetType()
SocketType Nz::AbstractSocket::GetType |
( |
| ) |
const |
|
inline |
Gets the internal type.
- Returns
- Socket type
◆ IsBlockingEnabled()
bool Nz::AbstractSocket::IsBlockingEnabled |
( |
| ) |
const |
|
inline |
Checks whether the blocking is enabled.
- Returns
- true If successful
◆ OnOpened()
void Nz::AbstractSocket::OnOpened |
( |
| ) |
|
|
protectedvirtual |
Operation to do when opening socket.
◆ Open() [1/2]
bool Nz::AbstractSocket::Open |
( |
NetProtocol |
protocol | ) |
|
|
protected |
Opens the socket according to a net protocol.
- Returns
- true If successful
◆ Open() [2/2]
void Nz::AbstractSocket::Open |
( |
SocketHandle |
handle | ) |
|
|
protected |
Opens the socket according to a socket handle.
- Returns
- true If successful
◆ operator=()
Moves the AbstractSocket into this.
- Returns
- A reference to this
- Parameters
-
◆ QueryAvailableBytes()
std::size_t Nz::AbstractSocket::QueryAvailableBytes |
( |
| ) |
const |
Queries the available bytes.
- Returns
- Number of bytes which can be read
◆ QueryReceiveBufferSize()
std::size_t Nz::AbstractSocket::QueryReceiveBufferSize |
( |
| ) |
const |
Queries the maximum socket receive buffer size.
- Returns
- The size of the receive buffer in bytes.
◆ QuerySendBufferSize()
std::size_t Nz::AbstractSocket::QuerySendBufferSize |
( |
| ) |
const |
Queries the maximum socket send buffer size.
- Returns
- The size of the send buffer in bytes.
◆ SetReceiveBufferSize()
void Nz::AbstractSocket::SetReceiveBufferSize |
( |
std::size_t |
size | ) |
|
Sets the maximum receive buffer size.
- Parameters
-
size | The new maximum receive buffer size in bytes |
◆ SetSendBufferSize()
void Nz::AbstractSocket::SetSendBufferSize |
( |
std::size_t |
size | ) |
|
Sets the maximum send buffer size.
- Parameters
-
size | The new maximum send buffer size in bytes |
◆ UpdateState()
void Nz::AbstractSocket::UpdateState |
( |
SocketState |
newState | ) |
|
|
inlineprotected |
Updates the state of the socket.
- Parameters
-
newState | Next state for the socket |
The documentation for this class was generated from the following files:
- include/Nazara/Network/AbstractSocket.hpp
- include/Nazara/Network/AbstractSocket.inl
- src/Nazara/Network/AbstractSocket.cpp