× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Bind the socket to an IP address
  • From: Scott Klement <klemscot@xxxxxxxxxxxx>
  • Date: Mon, 18 Dec 2000 10:57:06 -0600 (CST)


No, bind() should NOT be returning the IP address immediately.

Here's why:

    1) If you specified a specific IP when calling bind() you already know
          the IP.

    2) IF you did not specific a specific IP when calling bind(), the
          system doesn't know the IP until connect() or accept() has
          been issued.

Example:
   Your AS/400 has two ethernet cards, one to your accounting department's
   subnet which has IP address 192.168.1.1  and one to your IT dept's
   subnet which has IP address 192.168.2.1.    You write a program that
   binds to port 4444, but does not specific which IP address.  You 
   do a listen().   

   Someone from either the accounting dept or the IT dept can now connect
   to port 4444 on your AS/400.   Until that connection has been made,
   the AS/400 has no way to know which network card was used, and
   therefore cannot know the IP address.


Make sense?


On Thu, 14 Dec 2000 Contractor1@Parkdalemills.com wrote:

> I'm learning sockets from SServer in the 'Who Knew...RPG IV?'
> 
> In the program SServer, should I not see an IP value in SinAddr immediately
> after the bind process?
> 
> Patrick Conner
> www.ConnecTown.com
> (828) 244-0822

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.