[SDL] netlib & localhost

Sam Lantinga slouken at devolution.com
Sun Aug 1 22:51:17 PDT 1999


> Sam Lantinga wrote:
> > 
> > > > > it worked fine. Where in the chat program does it fail?
> > > > in SDLNet_ResolveHost("localhost", 35733)
> > > > it returned IPadress with port=127 and host=0 !!
> > > > It didn't work even with "127.0.0.1", that was translated into port=65535,
> > > > host=0. Strange.
> > 
> > > Very. SDLNet_ResolveHost uses the inet_addr() and gethostbyname()
> > > functions so either these are failing and/or the byte swap at the end of
> > > this function is doing weird things.
> > 
> > I was also told that there are problems with egcs and returning 8-byte
> > structures.  Try stepping into the function with gdb and verifying that
> > the values being returned are the same as the values actually returned.

> The calls to inet_addr and gethostbyname returns these values of IPaddress
> variable : host=16777343, port=38283 (hosts returned by inet_addr and
> gethostname are different). This value is passed to return(address); line.
> But after call to serverIP = SDLNet_ResolveHost(...);
> serverIP contains host=0, p=127. Seems there is some problem with returning
> struct...

This should be fixed in the CVS snapshot I'm releasing tonight.

	-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software
--
"Any sufficiently advanced bug is indistinguishable from a feature"
						 -- Rich Kulawiec 



More information about the SDL mailing list