本文整理汇总了C++中Csock::GetBytesWritten方法的典型用法代码示例。如果您正苦于以下问题:C++ Csock::GetBytesWritten方法的具体用法?C++ Csock::GetBytesWritten怎么用?C++ Csock::GetBytesWritten使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Csock
的用法示例。
在下文中一共展示了Csock::GetBytesWritten方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnWebRequest
bool OnWebRequest(CWebSock& WebSock, const CString& sPageName,
CTemplate& Tmpl) override {
if (sPageName == "index") {
if (CZNC::Get().GetManager().empty()) {
return false;
}
std::priority_queue<CSocketSorter> socks = GetSockets();
while (!socks.empty()) {
Csock* pSocket = socks.top().GetSock();
socks.pop();
CTemplate& Row = Tmpl.AddRow("SocketsLoop");
Row["Name"] = pSocket->GetSockName();
Row["Created"] = GetCreatedTime(pSocket);
Row["State"] = GetSocketState(pSocket);
Row["SSL"] = pSocket->GetSSL() ? "Yes" : "No";
Row["Local"] = GetLocalHost(pSocket, true);
Row["Remote"] = GetRemoteHost(pSocket, true);
Row["In"] = CString::ToByteStr(pSocket->GetBytesRead());
Row["Out"] = CString::ToByteStr(pSocket->GetBytesWritten());
}
return true;
}
return false;
}
示例2: ShowSocks
void ShowSocks(bool bShowHosts) {
if (CZNC::Get().GetManager().empty()) {
PutStatus("You have no open sockets.");
return;
}
std::priority_queue<CSocketSorter> socks = GetSockets();
CTable Table;
Table.AddColumn("Name");
Table.AddColumn("Created");
Table.AddColumn("State");
#ifdef HAVE_LIBSSL
Table.AddColumn("SSL");
#endif
Table.AddColumn("Local");
Table.AddColumn("Remote");
Table.AddColumn("In");
Table.AddColumn("Out");
while (!socks.empty()) {
Csock* pSocket = socks.top().GetSock();
socks.pop();
Table.AddRow();
Table.SetCell("Name", pSocket->GetSockName());
Table.SetCell("Created", GetCreatedTime(pSocket));
Table.SetCell("State", GetSocketState(pSocket));
#ifdef HAVE_LIBSSL
Table.SetCell("SSL", pSocket->GetSSL() ? "Yes" : "No");
#endif
Table.SetCell("Local", GetLocalHost(pSocket, bShowHosts));
Table.SetCell("Remote", GetRemoteHost(pSocket, bShowHosts));
Table.SetCell("In", CString::ToByteStr(pSocket->GetBytesRead()));
Table.SetCell("Out",
CString::ToByteStr(pSocket->GetBytesWritten()));
}
PutModule(Table);
return;
}