Roedy said:
Is there a mechanism either in Java or in Windows to reserve a socket?
I look at my /etc/services file, but then I run Linux. There's a
regularly updated list of port numbers at
http://www.iana.org/assignments/port-numbers
This replaces RFC 1700, which formerly contained the definitive list.
Is there a mechanism to find out if a socket is in use by some other
program?
netstat
It is available for *NIX systems and NT-based Windows systems, so it
should be available from Win 2K onwards. Use the -n option to see port
numbers: otherwise it shows the service name. Use -p to see the program
name and PID.
If you are a programmer, how do you go about deciding what socket to
use for some non-standard protocol?
I've noticed that the low 16000s are unused and tend to use those in
sequence so my servers don't clash.
Is this just something you expect the user to configure?
I assign a default port but make the port number configurable, via a
configuration file, command line option or both. If both, the command
line option overrides the config file.
Many common programs, both open source and proprietary, are written with
a default and configurable override. This includes most database and web
servers. Its essential for these to have configurable ports because its
not uncommon to run multiple copies on a server. Their clients must also
use configurable port assignments.
It turns out JetBrains IntelliJ Idea and something else that I have
not yet determined are fighting over the same sockets in the 6944
range.
According to the IANA database 6944 is unassigned, so imagine my
surprise. I hope their port assignments are configurable.
PS. what is the best PCI Ethernet card, fast, rock solid drivers for
Vista and Ubuntu?
I used to swear by 3COM and at Linksys. My only, seldom used,
Windows/Linux dual boot box has still got a 10 year old 3COM 10mb card
in it which has never given trouble.
This laptop has a D-Link DFE-670TXB PCMCIA card and my house server has
a RealTek RTL8139 installed. The D-Link and Realtek are both dual speed
10/100 devices and both have been trouble free for 2-3 years. My LAN is
based on a D-Link hub which has 'just run' for about 8 years.