set thread name / rename example
This commit is contained in:
@ -22,7 +22,7 @@ namespace ix
|
||||
std::set<uint64_t> DNSLookup::_activeJobs;
|
||||
std::mutex DNSLookup::_activeJobsMutex;
|
||||
|
||||
DNSLookup::DNSLookup(const std::string& hostname, int port, int wait) :
|
||||
DNSLookup::DNSLookup(const std::string& hostname, int port, int64_t wait) :
|
||||
_hostname(hostname),
|
||||
_port(port),
|
||||
_res(nullptr),
|
||||
|
@ -26,7 +26,7 @@ namespace ix
|
||||
public:
|
||||
DNSLookup(const std::string& hostname,
|
||||
int port,
|
||||
int wait = DNSLookup::kDefaultWait);
|
||||
int64_t wait = DNSLookup::kDefaultWait);
|
||||
~DNSLookup();
|
||||
|
||||
struct addrinfo* resolve(std::string& errMsg,
|
||||
@ -47,7 +47,7 @@ namespace ix
|
||||
|
||||
std::string _hostname;
|
||||
int _port;
|
||||
int _wait;
|
||||
int64_t _wait;
|
||||
std::string _errMsg;
|
||||
struct addrinfo* _res;
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "IXWebSocket.h"
|
||||
#include "IXSetThreadName.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
@ -25,8 +26,8 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
namespace ix {
|
||||
|
||||
namespace ix
|
||||
{
|
||||
OnTrafficTrackerCallback WebSocket::_onTrafficTrackerCallback = nullptr;
|
||||
|
||||
WebSocket::WebSocket() :
|
||||
@ -171,6 +172,8 @@ namespace ix {
|
||||
|
||||
void WebSocket::run()
|
||||
{
|
||||
setThreadName(_url);
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (_stop) return;
|
||||
|
Reference in New Issue
Block a user