TCP/IP Ports

 
SOLVED
Go to solution
John Donaldson
Occasional Contributor

TCP/IP Ports

I have read docs that say the ports are app controlled and not OS controlled with HP-UX. How can I open certain ports at the OS level?
What error message?
4 REPLIES 4
Andrew_4
Honored Contributor

Re: TCP/IP Ports

You need an application or process (be it part of the OS, or external) to open, use or listen on a port.

You can code your own process/program which opens and uses a port... using (I think) various bind system calls.

Andrew
The Unix Programmer's Manual, 2nd Edition, June, 1972: "The number of Unix installations has grown to 10, with more expected."
Andrew_4
Honored Contributor

Re: TCP/IP Ports

Also,

Within the C-Developer bundle for hpux, you'll find an example code for how to access port/ use port for interprocess communication.

Andrew
The Unix Programmer's Manual, 2nd Edition, June, 1972: "The number of Unix installations has grown to 10, with more expected."
Andrew_4
Honored Contributor
Solution

Re: TCP/IP Ports

I've found a couple of resources for you... to get you on your merry way in sockets programming :

http://world.std.com/~jimf/papers/sockets/sockets.html

http://www.ecst.csuchico.edu/~beej/guide/net/

http://www-sers.cs.umn.edu/~bentlema/unix/syscalls_and_iipc.html


Andrew
The Unix Programmer's Manual, 2nd Edition, June, 1972: "The number of Unix installations has grown to 10, with more expected."
James R. Ferguson
Acclaimed Contributor

Re: TCP/IP Ports

John:

A server process offers connections to clients. Such server processes offer connections on a port with a fixed number. Port numbers below 1024 are reserved and universally the constant (e.g. telnet uses port #23). An user application may be written as a server and it may use any port from 1024 to the maximum value 65,535.

The /etc/services file contains the universal numbers and names. Each individual site is free to add their own offerings to this file.

Clients in the socket paradigm also have port numbers associated with their socket. A socket is really an IPAddress plus a port number. Usually, because it doesn't matter, a client application will let the OS assign a port number for its socket, although clients, like servers, can specify a unique, fixed port.

...JRF...