How should I choose a port number for my server?
Answer / chaitanya
The list of registered port assignments can be found in STD 2 or RFC 1700. Choose one that isn't already registered, and isn't in /etc/services on your system. It is also a good idea to let users customize the port number in case of conflicts with other un- registered port numbers in other servers. The best way of doing this is hardcoding a service name, and using getservbyname() to lookup the actual port number. This method allows users to change the port your server binds to by simply editing the /etc/services file.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is a socket address?
What exactly does SO_LINGER do?
What is difference between socket () and serversocket () class?
How are unix domain sockets implemented?
What is a sae socket?
Can multiple sockets use the same port?
Why do I get connection refused when the server is not running?
What exactly is a socket?
How do I get my server to find out the clients address / host- name?
How do I get the port number for a given service?
What is LILO?
system choose one for me on the connect() call? Should I bind() a port number in my client program, or let the?