× 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: How is a socket id assignned?
  • From: Scott Klement <klemscot@xxxxxxxxxxxx>
  • Date: Wed, 24 Jan 2001 10:38:38 -0600 (CST)


The "socket numbers" (or file descriptors) don't mean anything.  They're
just a way of communicating with the API to tell it which open data stream
you're referring to.  (the Integrated File System API and Socket API draw
from the same pool of descriptor numbers, just as they do in Unix)

On a UNIX system (and presumably the AS/400 mimmicks this behavior for
compatability) the standard input "stdin" stream is 0, standard output is
(stdout) is 1 and standard error "stderr" is 2.

Therefore, the first descriptor that you open in each job (be it a file in
the IFS, or a socket, or what have you) will be 3, the next will be 4,
etc. which might explain the behavior you're seeing.

However, never rely on the numbers to mean anything in particular... doing
so would only be asking for trouble.


On Wed, 24 Jan 2001, Patrick Conner wrote:

> I'm working with SServer3 and SClient3 from "Who Knew...
> RPGIV?"
> 
> I'm seeing that both SServer3 and SClient3 are creating
> socket 3. In SServer3 the socket 3 is listening for clients.
> In SClient3 socket 3 is communicating to socket 4 in
> SServer3 once accepted.
> 
> I did some playing around because I thought socket 3 and
> socket 4 meant something to one another, but found out
> differently.
> 
> Once socket 3 was created in SClient3 I wrote to it and
> closed it. I then repeated this three or four times while
> SServer3 was in debug and sitting on an instruction. I
> started stepping through SServer3 at this point and found
> that socket 3 alternated communicationg to socket 4 and
> socket 5 in SServer3.
> 
> I guess socket ids don't mean much. They just go get ports.
> 
> Right?
> 
> 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.