On Monday 14 April 2008 18:42:26 Paul Chitescu wrote:

> Binding to a specific address is the only easy way of detecting which
> interface an UDP packet was received on since recvfrom() only gives source
> address, not destination. Listening on 0.0.0.0 would make impossible to
> tell which interface a packet was received on. Furthermore, a program that
> explicitely tries to bind to each interface would fail all but the first
> bind and possibly bail out. Probably many games that use UDP would break.

I'm currently trying to fix apps that fail doing the following (which seems to 
be a popular way among game developers), in pseudo-code. 

hostname = gethostname();
hostent = gethostbyname(hostname);
sockaddr->sin_addr = hostent->addr;
sock = socket();
bind(sock, sockaddr);

Which, as Christoph noted, cause windows apps to bind to loopback addresses, 
breaking the networking. This only started to happen recently as recently 
Linux distros started mapping the machine's hostname to a loopback address. I 
don't think Wine ever used the registry for anything like that.

Cheers,
Kai

-- 
Kai Blin
WorldForge developer  http://www.worldforge.org/
Wine developer        http://wiki.winehq.org/KaiBlin
Samba team member     http://www.samba.org/samba/team/
--
Will code for cotton.

Attachment: signature.asc
Description: This is a digitally signed message part.



Reply via email to