Permalink
Browse files

Add socket traffic stats to listsockets response

Not yet added to Web interface though.
  • Loading branch information...
1 parent 591b95e commit f244d7ab4518a1119c624be453fc95e1344ed49d @dgw dgw committed Feb 10, 2014
Showing with 5 additions and 0 deletions.
  1. +5 −0 modules/listsockets.cpp
View
@@ -118,6 +118,7 @@ class CListSockets : public CModule {
Row["SSL"] = pSocket->GetSSL() ? "Yes" : "No";
Row["Local"] = GetLocalHost(pSocket, true);
Row["Remote"] = GetRemoteHost(pSocket, true);
+ // TODO: Traffic stats
}
return true;
@@ -222,6 +223,8 @@ class CListSockets : public CModule {
#endif
Table.AddColumn("Local");
Table.AddColumn("Remote");
+ Table.AddColumn("In");
+ Table.AddColumn("Out");
while (!socks.empty()) {
Csock* pSocket = socks.top().GetSock();
@@ -238,6 +241,8 @@ class CListSockets : public CModule {
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);

0 comments on commit f244d7a

Please sign in to comment.