#include <Connection.h>
|
| ConnectionBase () |
|
virtual | ~ConnectionBase () |
|
Family | family () const |
|
virtual SocketType | type () const =0 |
|
virtual IPProto | proto () const =0 |
|
Socket | getSocket () const |
|
void | remove () |
|
void | removeAndDelete () |
|
const SockaddrIn & | getAddress () const |
|
int64_t | getReconnectTime () const |
|
virtual bool | isAutoConnectEnabled () const |
|
virtual bool | isConnected () const |
|
bool | shouldRemove () const |
|
bool | shouldDelete () const |
|
void | setNonblocking (bool val=true) |
| Sets socket non-blocking mode to val.
|
|
void | setDoNotProcess () |
|
virtual bool | reconnect () |
|
virtual bool | disconnect ()=0 |
|
bool | bind (uint16_t port) |
|
virtual bool | bind (AddrIn ip, uint16_t port) |
| Sets this connection up as a listener that will listen for and respond to incoming connection requests on the specified port.
|
|
bool | send (const void *data, uint64_t byteCount, uint64_t &bytesSent) |
| Attempts to send as much of the specified data as possible.
|
|
bool | receive (void *buffer, uint64_t byteCount, uint64_t &bytesReceived) |
| Attempts to read the specified number of bytes from the network socket this connection represents.
|
|
bool | sendTo (const void *data, uint64_t byteCount, uint64_t &bytesSent, const SockaddrIn &addr) |
| Attempts to send as much of the specified data as possible.
|
|
bool | recvFrom (void *buffer, uint64_t byteCount, uint64_t &bytesReceived, SockaddrIn &addr) |
| Attempts to read the specified number of bytes from the network socket this connection represents.
|
|
virtual bool | processOutgoing () |
|
virtual bool | processIncoming () |
|
|
void | create () |
| Internal wrapper for the socket() call.
|
|
void | close () |
| Internal wrapper for closing the socket.
|
|
|
static constexpr uint32_t | cRemove = 0x00000001 |
|
static constexpr uint32_t | cDelete = 0x00000002 |
|
static constexpr uint32_t | cDoNotProcess = 0x00000004 |
|
◆ ConnectionBase()
Cogs::Network::ConnectionBase::ConnectionBase |
( |
| ) |
|
|
inline |
◆ ~ConnectionBase()
virtual Cogs::Network::ConnectionBase::~ConnectionBase |
( |
| ) |
|
|
inlinevirtual |
◆ bind() [1/2]
bool Cogs::Network::ConnectionBase::bind |
( |
AddrIn |
ip, |
|
|
uint16_t |
port |
|
) |
| |
|
virtual |
◆ bind() [2/2]
bool Cogs::Network::ConnectionBase::bind |
( |
uint16_t |
port | ) |
|
|
inline |
◆ close()
void Cogs::Network::ConnectionBase::close |
( |
| ) |
|
|
protected |
◆ create()
void Cogs::Network::ConnectionBase::create |
( |
| ) |
|
|
protected |
◆ disconnect()
virtual bool Cogs::Network::ConnectionBase::disconnect |
( |
| ) |
|
|
pure virtual |
◆ family()
Family Cogs::Network::ConnectionBase::family |
( |
| ) |
const |
|
inline |
◆ getAddress()
const SockaddrIn & Cogs::Network::ConnectionBase::getAddress |
( |
| ) |
const |
|
inline |
◆ getReconnectTime()
int64_t Cogs::Network::ConnectionBase::getReconnectTime |
( |
| ) |
const |
|
inline |
◆ getSocket()
Socket Cogs::Network::ConnectionBase::getSocket |
( |
| ) |
const |
|
inline |
◆ isAutoConnectEnabled()
virtual bool Cogs::Network::ConnectionBase::isAutoConnectEnabled |
( |
| ) |
const |
|
inlinevirtual |
◆ isConnected()
virtual bool Cogs::Network::ConnectionBase::isConnected |
( |
| ) |
const |
|
inlinevirtual |
◆ processIncoming()
virtual bool Cogs::Network::ConnectionBase::processIncoming |
( |
| ) |
|
|
inlinevirtual |
◆ processOutgoing()
virtual bool Cogs::Network::ConnectionBase::processOutgoing |
( |
| ) |
|
|
inlinevirtual |
◆ proto()
virtual IPProto Cogs::Network::ConnectionBase::proto |
( |
| ) |
const |
|
pure virtual |
◆ receive()
bool Cogs::Network::ConnectionBase::receive |
( |
void * |
buffer, |
|
|
uint64_t |
byteCount, |
|
|
uint64_t & |
bytesReceived |
|
) |
| |
Attempts to read the specified number of bytes from the network socket this connection represents.
If, when returning true, bytesReceived is less than the specified byteCount, this function should be recalled to receive the remaining data.
References check_net_error.
Referenced by Cogs::Network::ConnectionHub::processIncoming().
◆ reconnect()
virtual bool Cogs::Network::ConnectionBase::reconnect |
( |
| ) |
|
|
inlinevirtual |
◆ recvFrom()
bool Cogs::Network::ConnectionBase::recvFrom |
( |
void * |
buffer, |
|
|
uint64_t |
byteCount, |
|
|
uint64_t & |
bytesReceived, |
|
|
SockaddrIn & |
addr |
|
) |
| |
◆ remove()
void Cogs::Network::ConnectionBase::remove |
( |
| ) |
|
|
inline |
◆ removeAndDelete()
void Cogs::Network::ConnectionBase::removeAndDelete |
( |
| ) |
|
|
inline |
◆ send()
bool Cogs::Network::ConnectionBase::send |
( |
const void * |
data, |
|
|
uint64_t |
byteCount, |
|
|
uint64_t & |
bytesSent |
|
) |
| |
◆ sendTo()
bool Cogs::Network::ConnectionBase::sendTo |
( |
const void * |
data, |
|
|
uint64_t |
byteCount, |
|
|
uint64_t & |
bytesSent, |
|
|
const SockaddrIn & |
addr |
|
) |
| |
◆ setDoNotProcess()
void Cogs::Network::ConnectionBase::setDoNotProcess |
( |
| ) |
|
|
inline |
◆ setNonblocking()
void Cogs::Network::ConnectionBase::setNonblocking |
( |
bool |
val = true | ) |
|
Sets socket non-blocking mode to val.
References socket.
◆ shouldDelete()
bool Cogs::Network::ConnectionBase::shouldDelete |
( |
| ) |
const |
|
inline |
◆ shouldRemove()
bool Cogs::Network::ConnectionBase::shouldRemove |
( |
| ) |
const |
|
inline |
◆ type()
virtual SocketType Cogs::Network::ConnectionBase::type |
( |
| ) |
const |
|
pure virtual |
◆ cDelete
constexpr uint32_t Cogs::Network::ConnectionBase::cDelete = 0x00000002 |
|
staticconstexprprotected |
◆ cDoNotProcess
constexpr uint32_t Cogs::Network::ConnectionBase::cDoNotProcess = 0x00000004 |
|
staticconstexprprotected |
◆ cRemove
constexpr uint32_t Cogs::Network::ConnectionBase::cRemove = 0x00000001 |
|
staticconstexprprotected |
◆ flags
Cogs::Atomic< uint32_t > Cogs::Network::ConnectionBase::flags = 0 |
|
protected |
◆ reconnectTime
int64_t Cogs::Network::ConnectionBase::reconnectTime = 0 |
|
protected |
◆ sockAddr
SockaddrIn Cogs::Network::ConnectionBase::sockAddr = {} |
|
protected |
◆ socket
The documentation for this class was generated from the following files: