home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!sdd.hp.com!elroy.jpl.nasa.gov!nntp-server.caltech.edu!tacos.caltech.edu!rtm
- From: rtm@tacos.caltech.edu (Raoul Machilvich)
- Newsgroups: vmsnet.networks.tcp-ip.multinet
- Subject: How can I get a free port number?
- Date: 11 Nov 1992 04:14 PST
- Organization: California Institute of Technology
- Lines: 22
- Distribution: world
- Message-ID: <11NOV199204141697@tacos.caltech.edu>
- NNTP-Posting-Host: tacos.caltech.edu
- News-Software: VAX/VMS VNEWS 1.40
-
- Hi,
-
- I am running Multinet 3.0 Rev. A. I was wondering if anyone could help
- me with the following problem.
-
- I have a computer which is booted via TCP from a VMS VAX. For reasons that
- are long and boring, I must supply the remote computer with the number of
- an unused TCP/IP port. This port must not be in use, in any state, at
- the time the computer boots. Is there any call or combination of calls
- that I could make to the Multinet subroutine library that would report to
- me an unused, or free, port number? Alternatively, I could just sequentially
- try port numbers if I knew of a subroutine that would tell me if a port
- was in use (it must not even be in a time-out or fin_wait state). I'm
- currently using a subroutine that examines the output of the
- MULTINET SHOW/CONN command, and finds a free port by brute force, but
- this is apt to win me few points for either elegance or efficiency.
-
- Thanks
- Taco (*)
- rtm@tacos.caltech.edu
-
- (*) The most irresponsible hiker Mark "Dolson" has ever known.
-