#include <C4AulDebug.h>
Public Types | |
typedef EndpointAddress | addr_t |
Public Member Functions | |
C4AulDebug () | |
~C4AulDebug () override | |
bool | Listen (uint16_t iPort, bool fWait) |
bool | isConnected () const |
void | SetPassword (const char *szPassword) |
bool | SetAllowed (const char *szHost) |
void | SetEngine (class C4AulExec *pnExec) |
bool | Init (uint16_t iPort) override |
bool | Close () override |
bool | Close (const addr_t &addr) override |
void | ControlScriptEvaluated (const char *script, const char *result) |
void | OnLog (const char *szLine) |
void | DebugStep (C4AulBCC *pCPos, C4Value *stackTop) |
virtual bool | InitBroadcast (addr_t *pBroadcastAddr) |
virtual bool | CloseBroadcast () |
bool | Execute (int iMaxTime=TO_INF, pollfd *readyfds=nullptr) override |
std::unique_ptr< Socket > | Bind (const addr_t &addr) |
bool | Connect (const addr_t &addr, std::unique_ptr< Socket > socket) |
bool | Connect (const addr_t &addr) override |
bool | Send (const C4NetIOPacket &rPacket) override |
virtual bool | Send (const class C4NetIOPacket &rPacket)=0 |
bool | Broadcast (const C4NetIOPacket &rPacket) override |
virtual bool | Broadcast (const class C4NetIOPacket &rPacket)=0 |
bool | SetBroadcast (const addr_t &addr, bool fSet=true) override |
virtual void | UnBlock () |
void | GetFDs (std::vector< struct pollfd > &FDs) override |
bool | GetStatistic (int *pBroadcastRate) override |
bool | GetConnStatistic (const addr_t &addr, int *pIRate, int *pORate, int *pLoss) override |
void | ClearStatistic () override |
void | SetCallback (CBClass *pnCallback) override |
bool | IsNotify () override |
virtual const char * | GetError () const |
void | ResetError () |
bool | ExecuteUntil (int iTimeout=-1) |
virtual C4TimeMilliseconds | GetNextTick (C4TimeMilliseconds tNow) |
bool | IsSignaled () |
virtual bool | IsLowPriority () |
virtual uint32_t | TimerInterval () |
Static Public Member Functions | |
static bool | InitDebug (const char *szPassword, const char *szHost) |
static C4AulDebug * | GetDebugger () |
static std::vector< HostAddress > | GetLocalAddresses () |
Static Public Attributes | |
static const int | TO_INF = -1 |
Protected Member Functions | |
bool | Connect (const addr_t &addr, SOCKET nsock) |
bool | Listen (uint16_t inListenPort) |
SOCKET | CreateSocket (addr_t::AddressFamily family) |
Peer * | Accept (SOCKET nsock=INVALID_SOCKET, const addr_t &ConnectAddr=addr_t()) |
Peer * | GetPeer (const addr_t &addr) |
void | OnShareFree (CStdCSecEx *pCSec) override |
void | AddConnectWait (SOCKET sock, const addr_t &addr) |
ConnectWait * | GetConnectWait (const addr_t &addr) |
void | ClearConnectWaits () |
bool | InitIPv6Socket (SOCKET socket) |
void | SetError (const char *strnError, bool fSockErr=false) |
void | Changed () |
Protected Attributes | |
Peer * | pPeerList {nullptr} |
struct C4NetIOTCP::ConnectWait | nullptr |
CStdCSecEx | PeerListCSec |
CStdCSec | PeerListAddCSec |
uint16_t | iListenPort |
SOCKET | lsock |
int | Pipe [2] |
StdCopyStrBuf | Error |
Definition at line 24 of file C4AulDebug.h.
|
inherited |
C4AulDebug::C4AulDebug | ( | ) |
Definition at line 31 of file C4AulDebug.cpp.
Referenced by InitDebug().
|
override |
Definition at line 36 of file C4AulDebug.cpp.
|
protectedinherited |
Definition at line 1427 of file C4NetIO.cpp.
References StdSchedulerProc::Changed(), C4NetIO::EndpointAddress::Clear(), CStdLock::Clear(), C4NetIOTCP::Peer::Close(), closesocket, C4NetIO::HostAddress::GetAddrLen(), C4NetIO::HostAddress::GetFamily(), INVALID_SOCKET, ioctlsocket, C4NetIOTCP::lsock, C4NetIOTCP::Peer::Next, C4NetIO::CBClass::OnConn(), C4NetIOTCP::Peer, C4NetIOTCP::PeerListAddCSec, C4NetIOTCP::PeerListCSec, C4NetIOTCP::pPeerList, C4NetIO::SetError(), SOCK_CLOEXEC, SOCKET_ERROR, and C4NetIO::HostAddress::UnknownFamily.
Referenced by C4NetIOTCP::Execute().
Definition at line 1651 of file C4NetIO.cpp.
References C4NetIOTCP::ConnectWait::addr, StdSchedulerProc::Changed(), C4NetIOTCP::ConnectWait::Next, C4NetIOTCP::PeerListAddCSec, C4NetIOTCP::PeerListCSec, C4NetIOTCP::ConnectWait::sock, and C4NetIOTCP::UnBlock().
Referenced by C4NetIOTCP::Connect().
|
inherited |
Definition at line 1192 of file C4NetIO.cpp.
References closesocket, C4NetIOTCP::CreateSocket(), C4NetIO::HostAddress::GetAddrLen(), C4NetIO::HostAddress::GetFamily(), INVALID_SOCKET, C4NetIO::SetError(), SOCKET, and SOCKET_ERROR.
|
overrideinherited |
Definition at line 1332 of file C4NetIO.cpp.
References C4NetIOPacket::getRef(), C4NetIOTCP::Peer::Next, C4NetIOTCP::PeerListCSec, C4NetIOTCP::pPeerList, and C4NetIOTCP::Send().
|
pure virtualinherited |
|
protectedinherited |
Definition at line 108 of file StdScheduler.cpp.
References s.
Referenced by C4NetIOTCP::Accept(), C4NetIOTCP::AddConnectWait(), C4NetIOUDP::AddPeer(), C4NetIOTCP::Listen(), and CStdTimerProc::SetDelay().
|
protectedinherited |
Definition at line 1677 of file C4NetIO.cpp.
References closesocket, C4NetIOTCP::ConnectWait::Next, and C4NetIOTCP::PeerListCSec.
Referenced by C4NetIOTCP::Close().
|
overridevirtualinherited |
Implements C4NetIO.
Definition at line 1419 of file C4NetIO.cpp.
References C4NetIOTCP::Peer::Next, C4NetIOTCP::PeerListCSec, and C4NetIOTCP::pPeerList.
|
overridevirtual |
Reimplemented from C4NetIOTCP.
Definition at line 181 of file C4AulDebug.cpp.
References C4NetIOTCP::Close().
Referenced by DebugStep(), and Init().
|
overridevirtual |
Reimplemented from C4NetIOTCP.
Definition at line 188 of file C4AulDebug.cpp.
References C4NetIOTCP::Close().
|
virtualinherited |
Definition at line 905 of file C4NetIO.cpp.
|
overridevirtualinherited |
Implements C4NetIO.
Definition at line 1214 of file C4NetIO.cpp.
References C4NetIOTCP::Connect(), C4NetIOTCP::CreateSocket(), C4NetIO::HostAddress::GetFamily(), INVALID_SOCKET, and SOCKET.
Definition at line 1223 of file C4NetIO.cpp.
References C4NetIOTCP::AddConnectWait(), closesocket, C4NetIO::HostAddress::GetAddrLen(), HaveWouldBlockError(), ioctlsocket, C4NetIO::SetError(), and SOCKET_ERROR.
Definition at line 1207 of file C4NetIO.cpp.
References INVALID_SOCKET, and SOCKET.
Referenced by C4Network2IOConnection::Connect(), C4NetIOTCP::Connect(), and C4Network2IRCClient::Connect().
void C4AulDebug::ControlScriptEvaluated | ( | const char * | script, |
const char * | result | ||
) |
Definition at line 438 of file C4AulDebug.cpp.
References FormatString().
|
protectedinherited |
Definition at line 1172 of file C4NetIO.cpp.
References closesocket, C4NetIO::InitIPv6Socket(), INVALID_SOCKET, C4NetIO::HostAddress::IPv6, C4NetIO::SetError(), SOCK_CLOEXEC, and SOCKET.
Referenced by C4NetIOTCP::Bind(), and C4NetIOTCP::Connect().
Definition at line 354 of file C4AulDebug.cpp.
References AB_DEBUG, Application, C4AulBCC::bccType, Close(), C4NetIOTCP::Execute(), FormatString(), Game, C4AulExec::GetContext(), C4AulExec::GetContextDepth(), StdStrBuf::getData(), C4Game::HaltCount, C4AulBCC::Par, and StdScheduler::ScheduleProcs().
|
overridevirtualinherited |
Implements C4NetIO.
Definition at line 919 of file C4NetIO.cpp.
References C4NetIOTCP::Accept(), C4NetIOTCP::fInit, C4NetIOTCP::GetFDs(), GetSocketErrorMsg(), HaveWouldBlockError(), C4NetIOTCP::iListenPort, INFINITE, INVALID_SOCKET, ioctlsocket, C4NetIOTCP::Listen(), C4NetIOTCP::lsock, C4NetIOTCP::Peer::Next, C4NetIO::CBClass::OnDisconn(), C4NetIOTCP::PeerListCSec, C4NetIOTCP::Pipe, C4NetIOTCP::pPeerList, ResetSocketError(), C4NetIO::SetError(), SOCKET, SOCKET_ERROR, and C4NetIO::TO_INF.
Referenced by DebugStep().
|
inherited |
Definition at line 33 of file StdScheduler.cpp.
References StdSchedulerProc::Execute(), and C4TimeMilliseconds::Now().
Referenced by main().
|
protectedinherited |
Definition at line 1667 of file C4NetIO.cpp.
References C4NetIOTCP::ConnectWait::Next, and C4NetIOTCP::PeerListCSec.
Referenced by C4NetIOTCP::Close().
|
overridevirtualinherited |
Implements C4NetIO.
Definition at line 1406 of file C4NetIO.cpp.
References C4NetIOTCP::Peer::GetIRate(), C4NetIOTCP::Peer::GetORate(), C4NetIOTCP::GetPeer(), C4NetIOTCP::Peer::Open(), and C4NetIOTCP::PeerListCSec.
|
inlinestatic |
Definition at line 31 of file C4AulDebug.h.
Referenced by C4AulScriptEngine::Clear(), C4Game::LinkScriptEngine(), and Log().
|
inlinevirtualinherited |
Definition at line 286 of file C4NetIO.h.
References C4NetIO::Error, and StdStrBuf::getData().
Referenced by C4Network2IO::ConnectWithSocket(), C4NetIOUDP::DoLoopbackTest(), C4StartupNetDlg::DoRefresh(), C4Network2IO::Init(), C4NetIOUDP::InitBroadcast(), main(), MyCBClass::OnConn(), C4ChatControl::OnConnectBtn(), MyCBClass::OnPacket(), C4ChatControl::ProcessInput(), and C4Network2IOConnection::Send().
|
overridevirtualinherited |
Reimplemented from StdSchedulerProc.
Definition at line 1364 of file C4NetIO.cpp.
References INVALID_SOCKET, C4NetIOTCP::lsock, C4NetIOTCP::Peer::Next, C4NetIOTCP::ConnectWait::Next, C4NetIOTCP::PeerListCSec, C4NetIOTCP::Pipe, and C4NetIOTCP::pPeerList.
Referenced by C4NetIOTCP::Execute().
|
staticinherited |
Definition at line 631 of file C4NetIO.cpp.
References C4NetIO::HostAddress::IsLoopback(), and C4NetIO::HostAddress::SetHost().
Referenced by C4Network2Client::AddLocalAddrs(), and C4NetIOUDP::InitBroadcast().
|
virtualinherited |
Reimplemented in CStdTimerProc, C4Network2IO, C4NetIOUDP, and C4HTTPClient.
Definition at line 115 of file StdScheduler.cpp.
References C4TimeMilliseconds::PositiveInfinity.
|
protectedinherited |
Definition at line 1593 of file C4NetIO.cpp.
References C4NetIOTCP::Peer::Next, C4NetIOTCP::PeerListCSec, and C4NetIOTCP::pPeerList.
Referenced by C4NetIOTCP::Close(), C4NetIOTCP::GetConnStatistic(), C4NetIOTCP::Send(), and C4NetIOTCP::SetBroadcast().
|
overridevirtualinherited |
Implements C4NetIO.
Definition at line 1399 of file C4NetIO.cpp.
|
overridevirtual |
Reimplemented from C4NetIOTCP.
Definition at line 163 of file C4AulDebug.cpp.
References Close(), C4NetIOTCP::Init(), C4NetIO::EndpointAddress::IPPORT_NONE, and C4NetIOTCP::SetCallback().
Referenced by Listen().
|
virtualinherited |
Definition at line 851 of file C4NetIO.cpp.
|
static |
Definition at line 43 of file C4AulDebug.cpp.
References AulExec, C4AulDebug(), SetAllowed(), SetEngine(), and SetPassword().
Referenced by C4Game::InitGame().
|
protectedinherited |
Definition at line 730 of file C4NetIO.cpp.
References C4NetIO::SetError(), and SOCKET_ERROR.
Referenced by C4NetIOTCP::CreateSocket(), C4NetIOSimpleUDP::Init(), and C4NetIOTCP::Listen().
|
inline |
Definition at line 69 of file C4AulDebug.h.
Referenced by Listen().
|
inlinevirtualinherited |
Definition at line 82 of file StdScheduler.h.
|
inlineoverridevirtualinherited |
|
inherited |
|
protectedinherited |
Definition at line 1538 of file C4NetIO.cpp.
References C4NetIO::HostAddress::Any, StdSchedulerProc::Changed(), closesocket, C4NetIO::HostAddress::GetAddrLen(), C4NetIOTCP::iListenPort, C4NetIO::InitIPv6Socket(), INVALID_SOCKET, C4NetIO::EndpointAddress::IPPORT_NONE, C4NetIOTCP::lsock, C4NetIO::SetError(), C4NetIO::EndpointAddress::SetPort(), SOCK_CLOEXEC, and SOCKET_ERROR.
Referenced by C4NetIOTCP::Execute(), and C4NetIOTCP::Init().
bool C4AulDebug::Listen | ( | uint16_t | iPort, |
bool | fWait | ||
) |
Definition at line 54 of file C4AulDebug.cpp.
References StdScheduler::Add(), Application, Init(), isConnected(), Log(), LogF(), LogFatal(), and StdScheduler::ScheduleProcs().
void C4AulDebug::OnLog | ( | const char * | szLine | ) |
Definition at line 197 of file C4AulDebug.cpp.
|
overrideprotectedvirtualinherited |
Implements CStdCSecExCallback.
Definition at line 1603 of file C4NetIO.cpp.
References C4NetIOTCP::Peer::Next, C4NetIOTCP::ConnectWait::Next, C4NetIOTCP::Peer::Open(), C4NetIOTCP::PeerListCSec, C4NetIOTCP::pPeerList, and C4NetIOTCP::ConnectWait::sock.
|
inlineinherited |
Definition at line 287 of file C4NetIO.h.
References StdStrBuf::Clear(), and C4NetIO::Error.
Referenced by C4NetIO::C4NetIO(), C4NetIOTCP::Close(), C4NetIOSimpleUDP::Close(), C4NetIOUDP::CloseBroadcast(), C4Network2IO::ConnectWithSocket(), C4NetIOSimpleUDP::Execute(), C4NetIOUDP::Execute(), C4NetIOSimpleUDP::Init(), C4NetIOSimpleUDP::InitBroadcast(), C4NetIOUDP::InitBroadcast(), C4NetIOSimpleUDP::Send(), and C4Network2IOConnection::Send().
|
overrideinherited |
Definition at line 1310 of file C4NetIO.cpp.
References C4NetIOPacket::getAddr(), C4NetIOTCP::GetPeer(), C4NetIOTCP::PeerListCSec, and C4NetIOTCP::Peer::Send().
Referenced by C4NetIOTCP::Broadcast(), C4NetIOTCP::Peer::Send(), and C4Network2IRCClient::Send().
|
pure virtualinherited |
Referenced by main(), MyCBClass::OnConn(), MyCBClass::OnPacket(), C4Network2IOConnection::Send(), and C4Network2IO::SendPuncherPacket().
bool C4AulDebug::SetAllowed | ( | const char * | szHost | ) |
Definition at line 152 of file C4AulDebug.cpp.
References C4NetIO::EndpointAddress::Clear(), C4NetIO::EndpointAddress::IsNull(), and C4NetIO::EndpointAddress::SetAddress().
Referenced by InitDebug().
|
overridevirtualinherited |
Implements C4NetIO.
Definition at line 1321 of file C4NetIO.cpp.
References C4NetIOTCP::GetPeer(), C4NetIOTCP::PeerListCSec, and C4NetIOTCP::Peer::SetBroadcast().
|
inlineoverridevirtualinherited |
Implements C4NetIO.
Definition at line 505 of file C4NetIO.h.
Referenced by C4Network2IRCClient::Connect(), and Init().
|
inline |
Definition at line 73 of file C4AulDebug.h.
Referenced by InitDebug().
|
protectedinherited |
Definition at line 750 of file C4NetIO.cpp.
References StdStrBuf::Copy(), C4NetIO::Error, StdStrBuf::Format(), GetSocketErrorMsg(), and HaveSocketError().
Referenced by C4NetIOTCP::Accept(), C4NetIOTCP::Bind(), C4NetIOSimpleUDP::CloseBroadcast(), C4NetIOTCP::Connect(), C4Network2IRCClient::Connect(), C4NetIOTCP::CreateSocket(), C4NetIOUDP::DoLoopbackTest(), C4NetIOSimpleUDP::Execute(), C4NetIOUDP::Execute(), C4NetIOTCP::Execute(), C4NetIOTCP::Init(), C4NetIOSimpleUDP::Init(), C4NetIOSimpleUDP::InitBroadcast(), C4NetIOUDP::InitBroadcast(), C4NetIO::InitIPv6Socket(), C4Network2IRCClient::Join(), C4NetIOTCP::Listen(), C4NetIOSimpleUDP::Send(), C4Network2IRCClient::Send(), C4NetIOTCP::UnBlock(), and C4NetIOSimpleUDP::UnBlock().
|
inline |
Definition at line 71 of file C4AulDebug.h.
Referenced by InitDebug().
|
inlinevirtualinherited |
|
virtualinherited |
Definition at line 1343 of file C4NetIO.cpp.
References C4NetIOTCP::Pipe, and C4NetIO::SetError().
Referenced by C4NetIOTCP::AddConnectWait().
|
protectedinherited |
Definition at line 283 of file C4NetIO.h.
Referenced by C4NetIO::GetError(), C4NetIO::ResetError(), and C4NetIO::SetError().
|
protectedinherited |
Definition at line 477 of file C4NetIO.h.
Referenced by C4NetIOTCP::Execute(), and C4NetIOTCP::Listen().
|
protectedinherited |
Definition at line 478 of file C4NetIO.h.
Referenced by C4NetIOTCP::Accept(), C4NetIOTCP::Close(), C4NetIOTCP::Execute(), C4NetIOTCP::GetFDs(), and C4NetIOTCP::Listen().
|
protectedinherited |
|
protectedinherited |
Definition at line 471 of file C4NetIO.h.
Referenced by C4NetIOTCP::Accept(), and C4NetIOTCP::AddConnectWait().
|
protectedinherited |
Definition at line 470 of file C4NetIO.h.
Referenced by C4NetIOTCP::Accept(), C4NetIOTCP::AddConnectWait(), C4NetIOTCP::Broadcast(), C4NetIOTCP::ClearConnectWaits(), C4NetIOTCP::ClearStatistic(), C4NetIOTCP::Close(), C4NetIOTCP::Execute(), C4NetIOTCP::GetConnectWait(), C4NetIOTCP::GetConnStatistic(), C4NetIOTCP::GetFDs(), C4NetIOTCP::GetPeer(), C4NetIOTCP::OnShareFree(), C4NetIOTCP::Send(), and C4NetIOTCP::SetBroadcast().
|
protectedinherited |
Definition at line 485 of file C4NetIO.h.
Referenced by C4NetIOTCP::Close(), C4NetIOTCP::Execute(), C4NetIOTCP::GetFDs(), C4NetIOTCP::Init(), and C4NetIOTCP::UnBlock().
Definition at line 458 of file C4NetIO.h.
Referenced by C4NetIOTCP::Accept(), C4NetIOTCP::Broadcast(), C4NetIOTCP::ClearStatistic(), C4NetIOTCP::Close(), C4NetIOTCP::Execute(), C4NetIOTCP::GetFDs(), C4NetIOTCP::GetPeer(), and C4NetIOTCP::OnShareFree().
|
staticinherited |
Definition at line 66 of file C4NetIO.h.
Referenced by C4NetIOUDP::Execute(), C4NetIOTCP::Execute(), C4NetIOUDP::Peer::OnConn(), C4NetIOUDP::Peer::OnTimeout(), and C4NetIOUDP::Peer::SetTimeout().