Merge 71873e490960d2471e70f62b847a6d5a6d968338 into 2f59ce490ecdeb85ba954f2485dbe48cad53a6e0

This commit is contained in:
arkanoid87 2018-07-22 12:30:46 +00:00 committed by GitHub
commit dfe94448cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -306,7 +306,7 @@ void myexit(int a)
printf("%s\n",RESET); printf("%s\n",RESET);
if(keep_thread_running) if(keep_thread_running)
{ {
if(pthread_cancel(keep_thread)) if(pthread_kill(keep_thread,SIGUSR1))
{ {
mylog(log_warn,"pthread_cancel failed\n"); mylog(log_warn,"pthread_cancel failed\n");
} }

View File

@ -1192,7 +1192,7 @@ int client_event_loop()
local_me.sin_addr.s_addr = local_ip_uint32; local_me.sin_addr.s_addr = local_ip_uint32;
if (bind(udp_fd, (struct sockaddr*) &local_me, slen) == -1) { if (::bind(udp_fd, (struct sockaddr*) &local_me, slen) == -1) {
mylog(log_fatal,"socket bind error\n"); mylog(log_fatal,"socket bind error\n");
//perror("socket bind error"); //perror("socket bind error");
myexit(1); myexit(1);
@ -1436,7 +1436,7 @@ int server_event_loop()
temp_bind_addr.sin_port = htons(local_port); temp_bind_addr.sin_port = htons(local_port);
temp_bind_addr.sin_addr.s_addr = local_ip_uint32; temp_bind_addr.sin_addr.s_addr = local_ip_uint32;
if (bind(bind_fd, (struct sockaddr*)&temp_bind_addr, sizeof(temp_bind_addr)) !=0) if (::bind(bind_fd, (struct sockaddr*)&temp_bind_addr, sizeof(temp_bind_addr)) !=0)
{ {
mylog(log_fatal,"bind fail\n"); mylog(log_fatal,"bind fail\n");
myexit(-1); myexit(-1);

View File

@ -1887,7 +1887,7 @@ int try_to_list_and_bind(int &fd,u32_t local_ip_uint32,int port) //try to bind
temp_bind_addr.sin_port = htons(port); temp_bind_addr.sin_port = htons(port);
temp_bind_addr.sin_addr.s_addr = local_ip_uint32; temp_bind_addr.sin_addr.s_addr = local_ip_uint32;
if (bind(fd, (struct sockaddr*)&temp_bind_addr, sizeof(temp_bind_addr)) !=0) if (::bind(fd, (struct sockaddr*)&temp_bind_addr, sizeof(temp_bind_addr)) !=0)
{ {
mylog(log_debug,"bind fail\n"); mylog(log_debug,"bind fail\n");
return -1; return -1;