Changeset - r11601:1946438aceee
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2009-04-08 11:57:00
rubidium@openttd.org
(svn r15980) -Codechange: don't try to bind to the same socket twice; it's quite pointless.
1 file changed with 7 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/network/core/address.cpp
Show inline comments
 
@@ -187,6 +187,13 @@ SOCKET NetworkAddress::Resolve(int famil
 

	
 
	SOCKET sock = INVALID_SOCKET;
 
	for (struct addrinfo *runp = ai; runp != NULL; runp = runp->ai_next) {
 
		/* When we are binding to multiple sockets, make sure we do not
 
		 * connect to one with exactly the same address twice. That's
 
		 * ofcourse totally unneeded ;) */
 
		if (sockets != NULL) {
 
			NetworkAddress address(runp->ai_addr, runp->ai_addrlen);
 
			if (sockets->Find(address) != sockets->End()) continue;
 
		}
 
		sock = func(runp);
 
		if (sock == INVALID_SOCKET) continue;
 

	
0 comments (0 inline, 0 general)