1
This commit is contained in:
parent
55268bb0fd
commit
b9f09fd360
@ -169,3 +169,15 @@ long long GCListener::GetSentBytesNum()
|
|||||||
{
|
{
|
||||||
return tcp_listener_->sent_bytes_num;
|
return tcp_listener_->sent_bytes_num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GCListener::GetWebSocketUrl(int socket_handle, std::string& url, std::string& query_str)
|
||||||
|
{
|
||||||
|
auto itr = websocket_url_hash_.find(socket_handle);
|
||||||
|
if (itr != websocket_url_hash_.end()) {
|
||||||
|
url = std::get<0>(itr->second);
|
||||||
|
query_str = std::get<1>(itr->second);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -33,7 +33,9 @@ class GCListener : public a8::Singleton<GCListener>
|
|||||||
void MarkClient(unsigned short sockhandle, bool is_active);
|
void MarkClient(unsigned short sockhandle, bool is_active);
|
||||||
long long GetSendNodeNum();
|
long long GetSendNodeNum();
|
||||||
long long GetSentBytesNum();
|
long long GetSentBytesNum();
|
||||||
|
bool GetWebSocketUrl(int socket_handle, std::string& url, std::string& query_str);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
a8::TcpListener *tcp_listener_ = nullptr;
|
a8::TcpListener *tcp_listener_ = nullptr;
|
||||||
|
std::map<int, std::tuple<std::string, std::string>> websocket_url_hash_;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user