mirror of
https://github.com/wangyu-/udp2raw.git
synced 2025-10-14 01:45:35 +08:00
sync easyfaketcp,fixed a bug in try_to_list_and_bind2
This commit is contained in:
@@ -2495,7 +2495,7 @@ int try_to_list_and_bind2(int &fd,address_t address) //try to bind to a port,ma
|
||||
mylog(log_debug,"bind fail\n");
|
||||
return -1;
|
||||
}
|
||||
if(raw_mode==mode_faketcp)
|
||||
if(raw_mode==mode_faketcp&&!use_tcp_dummy_socket)
|
||||
{
|
||||
|
||||
if (listen(fd, SOMAXCONN) != 0) {
|
||||
@@ -2528,7 +2528,8 @@ int client_bind_to_a_new_port2(int &fd,const address_t& address)//find a free po
|
||||
for(int i=0;i<1000;i++)//try 1000 times at max,this should be enough
|
||||
{
|
||||
tmp.set_port(raw_send_port);
|
||||
if (try_to_list_and_bind2(fd,address)==0)
|
||||
printf("<%s>\n",tmp.get_str());
|
||||
if (try_to_list_and_bind2(fd,tmp)==0)
|
||||
{
|
||||
return raw_send_port;
|
||||
}
|
||||
|
Reference in New Issue
Block a user