Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Oct 1996 08:26:15 -0500 (EST)
From:      Chuck Robey <chuckr@glue.umd.edu>
To:        Per Hojmark <per@via.net>
Cc:        hackers@freebsd.org
Subject:   Re: sockets programming question
Message-ID:  <Pine.OSF.3.95.961029082354.17710C-100000@skipper.eng.umd.edu>
In-Reply-To: <199610290018.QAA21190@mustang.via.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 28 Oct 1996, Per Hojmark wrote:

> 
> I want to build a database server process that:
>    -   listens on a port
>    -   connects to incoming users
>    -   forks to create new state & connection info for database.
>    -   does some database lookups
>    -   returns info to user 
>    -   closes connection.
>  
> So, suppose I was listening on port 1234, when I get a connection
> from a remote machine, do I need to switch to a new port number?
>  
> I notice that many programs use 'well known' port numbers, but after
> forking, seem to switch to a port > 1024. It appears that they use
> the 'well-known' port number just for the initial connection.

I'd like to suggest you go and buy a book that I think a lot of, Unix
Network Programming by W. Richard Stevens, where he gives complete
examples of programs doing exactly what you're describing.  It'll be well
worth your money, believe me.

>  
> -per
> 

----------------------------+-----------------------------------------------
Chuck Robey                 | Interests include any kind of voice or data 
chuckr@eng.umd.edu          | communications topic, C programming, and Unix.
9120 Edmonston Ct #302      |
Greenbelt, MD 20770         | I run Journey2 and n3lxx, both FreeBSD
(301) 220-2114              | version 2.2 current -- and great FUN!
----------------------------+-----------------------------------------------




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.OSF.3.95.961029082354.17710C-100000>