set thread name / rename example

This commit is contained in:
Benjamin Sergeant
2018-12-23 14:14:38 -08:00
parent bd04b28b9e
commit a79f4c10a1
24 changed files with 103 additions and 97 deletions

View File

@ -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),

View File

@ -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;

View File

@ -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;