Port端口是个伟大的发明。否则当我又想访问www.baidu.com获得他的网页,又想同时访问这台机器的sqlserver数据库获取数据库时怎么办呢?这时就用端口来区分。一个在80口,一个在1433端口。一个端口相对于一个程序(先不谈一个程序用多个端口的情况)。一台机器共有65536个端口。Port must be between 0 and 65535 inclusive.
顺便说一句:操作系统保留了使用端口1到端口1024的权力,所以没事别用这些端口。(if you really use 1023, it may not report error. It is only that you should not do like that. Like traffic regulation, you better conform to it. )
更多请见:http://www.mark-to-win.com/tutorial/java_9_WhyPort.html