if (addr_bind(udp_fd,&(s->local_addr),1,1,UDP_SOCKET) < 0) { TURN_LOG_FUNC(TURN_LOG_LEVEL_ERROR, "Cannot bind new detached udp server socket to local addr\n"); IOA_CLOSE_SOCKET(ret); return -1; }
ret->bound = 1;
{ int connect_err = 0; if (addr_connect(udp_fd, &(server->sm.m.sm.nd.src_addr), &connect_err) < 0) { char sl[129]; char sr[129]; addr_to_string(&(ret->local_addr),(u08bits*)sl); addr_to_string(&(server->sm.m.sm.nd.src_addr),(u08bits*)sr); TURN_LOG_FUNC(TURN_LOG_LEVEL_ERROR, "Cannot connect new detached udp client socket from local addr %s to remote addr %s\n",sl,sr); IOA_CLOSE_SOCKET(ret); return -1; } }
--
You received this message because you are subscribed to the Google Groups "TURN Server (Open-Source project)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to turn-server-project-rfc57...@googlegroups.com.
To post to this group, send email to turn-server-project...@googlegroups.com.
Visit this group at https://groups.google.com/group/turn-server-project-rfc5766-turn-server.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to turn-server-project-rfc5766-turn-server+unsubscribe@googlegroups.com.
To post to this group, send email to turn-server-project-rfc5766-turn-...@googlegroups.com.
thanks for sharing that ,it's very helpful. .
在 2016年2月16日星期二 UTC+8上午1:54:37,Oleg Moskalenko写道:The problem that you described is due to the naturally occurring race condition that happens because we cannot make bind() and connect() as single transaction.But that scenario happens only with the 'network engine 1' in the TURN server, and that is only BSD-type of OSes, currently. Only those OSes use 'network engine 1' by default (that creates a separate client-handling UDP socket for each session). The network engines 2 & 3 use connection multiplexing. Fedora22 uses network engine 3 that creates a single client-facing UDP socket per CPU - unless you are forcing it to use the network engine 1 with --ne option.Please file an Issue in the git project page. Meanwhile, you can use a workaround - force your system to use 'network engine 1' with --ne=1 option.
To unsubscribe from this group and stop receiving emails from it, send an email to turn-server-project-rfc57...@googlegroups.com.
To post to this group, send email to turn-server-project...@googlegroups.com.