diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-02-08 23:01:44 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-02-08 23:01:44 +0100 |
commit | efe77ba63b1e519fc4d563bd9b599277c4bd96e5 (patch) | |
tree | 85eff52bd7735d19f3bac254ad9cce1fb863de43 /src/commands | |
parent | 689996cb8856af43a033eb5ca1cb9df7475c0854 (diff) |
Change all socketengine methods to be static
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/cmd_dns.cpp | 8 | ||||
-rw-r--r-- | src/commands/cmd_stats.cpp | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/commands/cmd_dns.cpp b/src/commands/cmd_dns.cpp index 4af8b2c9e..63924d87b 100644 --- a/src/commands/cmd_dns.cpp +++ b/src/commands/cmd_dns.cpp @@ -519,7 +519,7 @@ class MyManager : public Manager, public Timer, public EventHandler return; } - if (ServerInstance->SE->SendTo(this, buffer, len, 0, &this->myserver.sa, this->myserver.sa_size()) != len) + if (SocketEngine::SendTo(this, buffer, len, 0, &this->myserver.sa, this->myserver.sa_size()) != len) throw Exception("DNS: Unable to send query"); } @@ -567,7 +567,7 @@ class MyManager : public Manager, public Timer, public EventHandler irc::sockets::sockaddrs from; socklen_t x = sizeof(from); - int length = ServerInstance->SE->RecvFrom(this, buffer, sizeof(buffer), 0, &from.sa, &x); + int length = SocketEngine::RecvFrom(this, buffer, sizeof(buffer), 0, &from.sa, &x); if (length < Packet::HEADER_LENGTH) return; @@ -681,7 +681,7 @@ class MyManager : public Manager, public Timer, public EventHandler { if (this->GetFd() > -1) { - ServerInstance->SE->DelFd(this); + SocketEngine::DelFd(this); SocketEngine::Shutdown(this, 2); SocketEngine::Close(this); this->SetFd(-1); @@ -713,7 +713,7 @@ class MyManager : public Manager, public Timer, public EventHandler SocketEngine::Close(this); this->SetFd(-1); } - else if (!ServerInstance->SE->AddFd(this, FD_WANT_POLL_READ | FD_WANT_NO_WRITE)) + else if (!SocketEngine::AddFd(this, FD_WANT_POLL_READ | FD_WANT_NO_WRITE)) { ServerInstance->Logs->Log("RESOLVER", LOG_SPARSE, "Resolver: Internal error starting DNS - hostnames will NOT resolve."); SocketEngine::Close(this); diff --git a/src/commands/cmd_stats.cpp b/src/commands/cmd_stats.cpp index afcbe01e6..9510136ff 100644 --- a/src/commands/cmd_stats.cpp +++ b/src/commands/cmd_stats.cpp @@ -139,7 +139,7 @@ void CommandStats::DoStats(char statschar, User* user, string_list &results) for (ClassVector::iterator i = ServerInstance->Config->Classes.begin(); i != ServerInstance->Config->Classes.end(); i++) { ConnectClass* c = *i; - results.push_back("215 "+user->nick+" i NOMATCH * "+c->GetHost()+" "+ConvToStr(c->limit ? c->limit : ServerInstance->SE->GetMaxFds())+" "+ConvToStr(idx)+" "+ServerInstance->Config->ServerName+" *"); + results.push_back("215 "+user->nick+" i NOMATCH * "+c->GetHost()+" "+ConvToStr(c->limit ? c->limit : SocketEngine::GetMaxFds())+" "+ConvToStr(idx)+" "+ServerInstance->Config->ServerName+" *"); results.push_back("218 "+user->nick+" Y "+ConvToStr(idx)+" "+ConvToStr(c->GetPingTime())+" 0 "+ConvToStr(c->GetSendqHardMax())+" :"+ ConvToStr(c->GetRecvqMax())+" "+ConvToStr(c->GetRegTimeout())); idx++; @@ -182,7 +182,7 @@ void CommandStats::DoStats(char statschar, User* user, string_list &results) break; case 'E': { - const SocketEngine::Statistics& stats = ServerInstance->SE->GetStats(); + const SocketEngine::Statistics& stats = SocketEngine::GetStats(); results.push_back("249 "+user->nick+" :Total events: "+ConvToStr(stats.TotalEvents)); results.push_back("249 "+user->nick+" :Read events: "+ConvToStr(stats.ReadEvents)); results.push_back("249 "+user->nick+" :Write events: "+ConvToStr(stats.WriteEvents)); @@ -212,7 +212,7 @@ void CommandStats::DoStats(char statschar, User* user, string_list &results) float kbitpersec_in, kbitpersec_out, kbitpersec_total; char kbitpersec_in_s[30], kbitpersec_out_s[30], kbitpersec_total_s[30]; - ServerInstance->SE->GetStats().GetBandwidth(kbitpersec_in, kbitpersec_out, kbitpersec_total); + SocketEngine::GetStats().GetBandwidth(kbitpersec_in, kbitpersec_out, kbitpersec_total); snprintf(kbitpersec_total_s, 30, "%03.5f", kbitpersec_total); snprintf(kbitpersec_out_s, 30, "%03.5f", kbitpersec_out); |