预留的TCP/IP端口 [英] Reserved TCP/IP ports

查看:69
本文介绍了预留的TCP/IP端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

保留的TCP/IP端口是否需要运行程序并将其绑定到该端口?如果没有这样的程序正在运行或存在,另一个程序可以使用这个端口吗?例如,在Linux上,端口7保留用于回显服务器.我假设有一些程序正在运行,并且绑定到计算机的端口7.该程序基本上回显输入.如果该程序停止,端口7是否会被释放?

Do reserved TCP/IP ports require that a program is running and bound to the port? If no such program is running or exists, can another program use this port? For example, on Linux, port 7 is reserved for an echo server. I assume there is some program running and is bound to port 7 of the machine. The program basically echos back input. If this program is stopped, will port 7 be released?

如果我编写了自己的回显服务器并将其绑定到其他端口,那么一旦我的自定义回显服务器程序被杀死,就不会释放该端口吗?

If I wrote my own echo server and bound it to some other port, wouldn't this port be released once my custom echo server program is killed?

保留端口会发生同样的事情吗?

Does the same thing happen for reserved ports?

此外,如果所有这些程序都在保留端口上运行,即使被阻止监听连接,它们也不会消耗系统资源吗?这些程序是否一直在运行?

Also, if all these programs are running on reserved ports, wouldn't they consume system resources even if they are blocked listening for a connection? Are these programs running at all times?

推荐答案

保留的TCP/IP端口是否要求程序正在运行并绑定到该端口?

Do reserved TCP/IP ports require that a program is running and bound to the port?

否.

如果没有这样的程序正在运行或不存在,另一个程序可以使用该端口吗?

If no such program is running or exists, can another program use this port?

没什么阻止您的,但它仍然保留,如果您滥用保留用于其他用途的端口,用户有权向您投诉.

Nothing to stop you, but it's still reserved, and users are entitled to complain to you if you misuse ports reserved for something else.

例如,在Linux上,端口7保留用于回显服务器.我假设有一些程序正在运行,并且绑定到计算机的端口7.该程序基本上回显输入.如果该程序停止,端口7是否会释放?

For example, on Linux, port 7 is reserved for an echo server. I assume there is some program running and is bound to port 7 of the machine. The program basically echos back input. If this program is stopped, will port 7 be released?

是的

如果我编写了自己的回显服务器并将其绑定到其他端口,那么一旦我的自定义回显服务器程序被杀死,就不会释放该端口吗?

If I wrote my own echo server and bound it to some other port, wouldn't this port be released once my custom echo server program is killed?

是的

保留端口会发生同样的事情吗?

Does the same thing happen for reserved ports?

是的,当然.

此外,如果所有这些程序都在保留端口上运行,那么即使它们被阻止侦听连接,它们也不会消耗系统资源吗?

Also, if all these programs are running on reserved ports, wouldn't they consume system resources even if they are blocked listening for a connection?

是的

这些程序是否一直在运行?

Are these programs running at all times?

它们正在运行还是没有运行.您要同时询问这两种情况.如果您的意思是执行中"(即消耗CPU),答案是否定的,那么当没有连接时,它们将被阻止等待连接.

Either they are running or they aren't running. You're asking about both situations at the same time. If you mean 'executing', i.e. consuming CPU, the answer is no, they are blocked waiting for connections while there are no connections.

这篇关于预留的TCP/IP端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆