|
Scott,
Our GUI package (which the client and server programs are part of) was not
made in-house, so I don't think I could follow this route.
Even if I had any experience with sockets... I do have your excellent
tutorial on my pc for some light reading in-between development ;-)
Thanks,
Peter Colpaert
Application Developer
Massive - Kontich, Belgium
-----
Yoda of Borg are we. Futile is resistance, assimilated will you be.
-----
Scott Klement <midrange-l@xxxxxxxxxxxxxxxx>
Sent by: midrange-l-bounces@xxxxxxxxxxxx
04/01/2005 18:32
Please respond to Midrange Systems Technical Discussion
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
cc:
Subject: Re: Retrieving remote IP address
Hello,
> the client is a Windows application, which connects (through a socket, I
> guess) to a listener program on the iSeries.
>
> So as far as I can see it, the job is not submitted by the client, but
by
> the listener program.
When the listener program calls the accept() API, the 2nd parameter to
accept() is a sockaddr data structure that will contain the IP address of
the socket that has connected to it.
You can also retrieve this information later by passing the socket
descriptor that's connected to the remote computer to the getpeername()
API.
The IP address that these APIs return will be in binary format (i.e.,
x'7F000001' instead of 127.0.0.1) but you can convert it to human-readable
("dotted") format using the inet_ntoa() API.
--
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.