SCOUG-Programming Mailing List Archives
Return to [ 01 |
October |
1998 ]
<< Previous Message <<
Content Type: text/plain
-----BEGIN PGP SIGNED MESSAGE-----
On Thu, 1 Oct 1998 21:20:00 PDT, Peter Skye wrote:
>You know, I'm reading my own post and even _I_ can't understand it.
>
>Peter Skye wrote:
>>
>> How do you block ports from being assigned?
>> (and a bunch of mumbo jumbo afterwards)
>
>I'll try again.
>
>If we start the FTP server, it listens at some preassigned port. If a
>user logs in, they're given a different port on which to conduct
>business.
>
>Where do we list ports that we don't want the FTP (or other) server to
>assign to a user? My specific reason is that I might have some "other"
>server which only runs occasionally, and this "other" server listens at
>some preassigned (but different) port just like the FTP server. I don't
>want the FTP server to ever assign that particular port to a user, so
>that it's always available in case I start my "other" server.
>
>Example: My "other" server listens at port 2300, but I haven't started
>it yet. The FTP server sees a user log on and (through TCP/IP, I guess)
>assigns a unique port to that user. If port 2300 is, by chance,
>assigned to the FTP user, then I can't start my "other" server.
>
>- Peter Skye
As I understand it (and I might be wrong), ports do not get "used up"
on a system because they are assigned on a per-process basis. You can
find a list of the default assignments in /mptn/etc/services where you
see the default ports for FTP are 20 and 21.
If the FTP server gets a request from joe@abc.net on port 20, it
spawns child process "A" that has the established connection on port
20. The child process then opens a data connection with joe@abc.net on
port 21 and then does all of the file transfers. The parent process
then closes its connection on port 20 and then re-opens port 20 to
listen for the next user. If fred@def.com then connects on port 20,
the server spawns another child process "B". It is up to the tcp stack
to keep track of who gets which data. When a packet comes in for port
20 from joe@abc.net, the OS gives it to child process "A". A packet
for port 20 from fred@def.net goes to process "B".
Think of the ports as file designators. You can be running many
processes that use 'stdin' at the same time. But different processes
will have different file associations with 'stdin'. At least that is
my understanding from setting up communicating processes on Unix. Whe
you fork a process, both processes share the file descriptors and the
parent must close the file so the child process can use it. I would
assume that ports act the same way.
-- Greg Smith
===============================================================
Gregory W. Smith (WD9GAY) gsmith@well.com
finger gsmith@well.com for PGP public key
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
iQCVAwUBNhR29DtML4mvizAhAQGMlgP8DukI/01crqfjCuH4th/4KzcvIDtd7yFT
4SF5/Dak3Xzy5emGAI8n9o9BQW6amV4uwxbp+TBkwsygiqfgx8s+D1IuIZbBC90X
Gab4FmpKBR87rKZf/Hkb9pzo68K5EPk4ZHE7qoLsYC2LFgnUikiBuCRns1TJCpYl
KODTZfnzpGo=
=TMjr
-----END PGP SIGNATURE-----
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".
For problems, contact the list owner at
"rollin@scoug.com".
=====================================================
<< Previous Message <<
Return to [ 01 |
October |
1998 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
|