× 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.



rresvport() is not a standard.  It's not part of any ISO or POSIX standard
to my knowledge, it's just a BSD extension...   you won't find it on every
platform, if you want your routines to be portable, don't use it.

To get a fixed port number, just call socket() followed by bind()  (before
calling connect() you need to call bind())

The only time rresvport() acts a little differently than just calling
socket & bind is if you specify a port number of zero.

In the case of port zero... rresvport() will auto-assign a port number
within the "restricted port number" range (i.e. ports btw 512 & 1023).
You can achieve this on OS/400 by calling bind() in a loop, until it
is successful...

I don't know why the ldap_init() API makes reference to rresvport.  I
would guess that the documentation was written the same way for multiple
operating systems, and IBM just didn't change it.


On Thu, 24 Apr 2003, Vengoal Chang wrote:

> Dear All,
>       I have a request for fixed socket client port number. Socket
> default assign random port for connection used. I want to fixed socket
> client port number on AS/400. I found a function rresvport() on AIX can
> do the function. I only found the word "rresvport()" on information
> center ldap API , the ldap_init()--Perform an LDAP Initialization
> Operation
> http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/apis/ldap_init.ht
> m
>
> Document include call rresvport() function, But I could not found the
> API with API finder and not list in Socket API. Could someone teach me
> how do I fixed socket client port number on AS/400 ?
>

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.