Netlib & localhost

Hi,
is there any way how to make netlib sample (chat, chatd) running on local
computer under Linux? I tried launching chatd and then run “chat localhost” but
it refused to connect and only said “connect failed”.

Vaclav

is there any way how to make netlib sample (chat, chatd) running on local
computer under Linux? I tried launching chatd and then run “chat localhost” but
it refused to connect and only said “connect failed”.

I have tried this - running chatd and then running ‘chat localhost’ and
it worked fine. Where in the chat program does it fail?

paul.–


Paul Furber
TML Trade Publishing
+27-11-789-2144 (t)
+27-11-789-7194 (f)
paulf at icon.co.za


Paul Furber wrote:

is there any way how to make netlib sample (chat, chatd) running on local
computer under Linux? I tried launching chatd and then run “chat localhost” but
it refused to connect and only said “connect failed”.

I have tried this - running chatd and then running ‘chat localhost’ and
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.

Vaclav

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.

/mav–


Paul Furber
TML Trade Publishing
+27-11-789-2144 (t)
+27-11-789-7194 (f)
paulf at icon.co.za


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.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

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…

Vaclav

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

Sam Lantinga wrote:

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.

GREAT!

Vasek