|
Q & A on Port selection and coding questions for clients and servers
Q: I am in the process of coding clients and servers. Is there a way to get a list of available ports from one's operating system? Is there a system call? A: If you want to find out which ports are currently used on the local computer, the answer is 'no'. Q: When writing a server, how does one know which port is available? A: To define an official service for the Internet, you must obtain a port number assignment. If you merely want to avoid the ports that are reserved for ``well known'' services, you should consult the Assigned Numbers RFC and choose a number greater than those listed. Q: What are FAR* and FAR** pointer types? A: The original Intel architecture used a base-displacement form of relative addressing; later versions of the architecture allowed full pointers, but require FAR to distinguish it (i.e., FAR has nothing to do with networking). Q: My 'accept' call is not blocking. Does one need to explicitly tell NT that 'accept' should block if no client request yet exists? A: No, NT does not require you to specify blocking. You have made an error; check the return code. |