Alaska Software Inc. - IP Number Retrieval under WINE
Username: Password:
AuthorTopic: IP Number Retrieval under WINE
Jose Luis OterminIP Number Retrieval under WINE
on Mon, 16 Sep 2002 13:01:46 -0300
Hi!

I'm experimenting with the sample program provided by ASInet.
Attached are source code for SERVER.exe and ERROR.LOG generated by the App
running on WINE on RedHat Linux 7.3.
On the client side, running Win 98 SE, it runs OK.
To clear the concepts:
If the SERVER.PRG is compiled on Win98 and runs on Win98, it does it well.
If the same .EXE runs on WINE it gives the error detailed at ERROR.LOG.

The offending instruction seems to be:

cServerIP :=
SocketInetNtoA(SocketGetHostByName(SocketGetHostName())[HOSTINFO_ADDR,1])

The underlaying idea is to get the IP number of the server and/or Client.
Any ideas?

TIA

Regards

--
 Jos Luis Otermin

oterminATciudad.com.ar







server.prg
error.log
Andreas Gehrs-Pahl Re: IP Number Retrieval under WINE
on Tue, 17 Sep 2002 00:56:35 +0200
Jose Luis,

>The offending instruction seems to be:

>cServerIP :=
>SocketInetNtoA(SocketGetHostByName(SocketGetHostName())[HOSTINFO_ADDR,1])

According to the error log, the error occurred when you tried to access an
item of the aHostInfo array, but the previous line "SocketGetHostByName()"
apparently returned NIL, probably because of an error in that or a previous 
function, like "SocketGetHostName()".

Modify the test program, so it returns error codes -- this might shed some
light on the actual (Socket) error that occurred before. All those functions 
can return error codes - check the online help for details.

HTH,

-- Andreas

---                                                                       ---
  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
  415 Gute Street                     or: schnars@ais.org
  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
---                                                                       ---
Jose Luis OterminRe: IP Number Retrieval under WINE
on Tue, 17 Sep 2002 13:09:12 -0300
Hi Andreas,

> >The offending instruction seems to be:
>
> >cServerIP :=
> >SocketInetNtoA(SocketGetHostByName(SocketGetHostName())[HOSTINFO_ADDR,1])
>
> According to the error log, the error occurred when you tried to access an
> item of the aHostInfo array, but the previous line "SocketGetHostByName()"
> apparently returned NIL, probably because of an error in that or a
previous
> function, like "SocketGetHostName()".

It seems to be something related with WINE, due there is not such fail in
Win98 SE.

> Modify the test program, so it returns error codes -- this might shed some
> light on the actual (Socket) error that occurred before. All those
functions
> can return error codes - check the online help for details.

I'm adding some error code generation so it will do it as you wisely said.
Thanks for the tip.
I'll keep the NG posted with the news. 
Regards


--
 Jos Luis Otermin

oterminATciudad.com.ar
ICQ 8797524