简体   繁体   English

我可以在我的VCL客户端服务器应用程序的端口中使用端口80吗?

[英]Can I use port 80 in my VCL client-server app's

Usually I use some random port for my client-server applications in Delphi/C++ Builder. 通常我在Delphi / C ++ Builder中为我的客户端服务器应用程序使用一些随机端口。 But, since I work in a building with a strong firewall policies I would like to use port 80 (TCP and/or UDP). 但是,由于我在具有强大防火墙策略的建筑物中工作,因此我想使用端口80(TCP和/或UDP)。

My question is, will I have any problems in my client-server communication if there are other applications using the same port? 我的问题是,如果其他应用程序使用同一端口,我的客户端-服务器通信是否会出现问题? I suppose my server will pick up that communication as well? 我想我的服务器也将接听该通讯吗? I would like to avoid any possible conflicts with other app's. 我想避免与其他应用程序发生任何冲突。

Yes you will have problems, if there is an application which is listening to port 80, then you can not use that port. 是的,您会遇到问题,如果有一个正在监听端口80的应用程序,那么您将无法使用该端口。

Notice, Browsers use port 80 as target ports, they don't listen to 80. So, don't count them when you want use that port. 请注意,浏览器将端口80用作目标端口,它们不会监听80。因此,当您要使用该端口时,请勿将其计数。

If I understand your question correctly, you appear to be concerned about the ports on the client-side, not the server side. 如果我正确理解了您的问题,则您似乎担心的是客户端(而不是服务器)上的端口。 Your application is free to connect to a server which is listening on port 80 and it will not interfere with any other client applications running on the same machine. 您的应用程序可以自由连接到正在侦听端口80的服务器,并且不会干扰同一台计算机上运行的任何其他客户端应用程序。 If it did interfere, things like multiple browsers / tabs would not be possible. 如果确实造成干扰,则无法使用多个浏览器/选项卡。

There are some excellent answers on this question which explain in more detail how ports work. 这个问题有一些很好的答案,它们更详细地解释了端口如何工作。

There can only be problems if there are other servers listening on port 80 on the server machine. 仅当有其他服务器在服务器计算机上的端口80上侦听时,才会出现问题。 In this case your application would not be able to bind to port 80. The app will not interfere with web browsers, because they use a random port on the client side. 在这种情况下,您的应用程序将无法绑定到端口80。该应用程序将不会干扰Web浏览器,因为它们在客户端使用随机端口。

如果网络使用应用程序层防火墙 ,则它们可以通过端口80阻止非HTTP数据。因此,如果您的应用程序仅使用端口80,“因为它不受大多数​​防火墙的保护”,请准备好使用更严格的防火墙设置,这样做不允许您的客户端/服务器通信。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM