gpt4 book ai didi

client - OpenJMS - 客户端端口号

转载 作者:行者123 更新时间:2023-12-01 04:00:18 26 4
gpt4 key购买 nike

关于 Bart 在 NAT router blocking JMS messages 中遇到的问题
我试图找到客户端接收 openJMS 消息的端口号。在网上搜索了很久之后,我只能找到有关服务器端口的信息,而在客户端上找不到任何信息。这是用于 tcp 连接。

如果有人能指出我正确的方向,我将不胜感激。

谢谢!

最佳答案

通常,每个新连接的客户端端口号都会不同。 我找不到 OpenJMS 客户端在与服务器通信时使用特定端口号的证据。 这里有一些解释。

  • Port Numbers

    When a client process first contacts a server process, it may use a well-known port number to initiate communication. Well-known port numbers are assigned to particular services throughout the Internet, by IANA, the Internet Assigned Numbers Authority. The well-known port numbers are in the range 0 through 1023.

    Well-known ports are used only to establish communication between client and server processes. When this has been done, the server allocates an ephemeral port number for subsequent use. Ephemeral port numbers are unique port numbers which are assigned dynamically when processes start communicating. They are released when communication is complete.

  • TCP/IP Client (Ephemeral) Ports and Client/Server Application Port Use

    In contrast, servers respond to clients; they do not initiate contact with them. Thus, the client doesn't need to use a reserved port number. In fact, this is really an understatement: a server shouldn't use a well-known or registered port number to send responses back to clients. The reason is that it is possible for a particular device to have both client and server software of the same protocol running on the same machine. If a server received an HTTP request on port 80 of its machine and sent the reply back to port 80 on the client machine, it would be sending the reply to the client machine's HTTP server process (if present) and not the client process that sent the initial request.

    To know where to send the reply, the server must know the port number the client is using. This is supplied by the client as the Source Port in the request, and then used by the server as the destination port to send the reply. Client processes don't use well-known or registered ports. Instead, each client process is assigned a temporary port number for its use. This is commonly called an ephemeral port number.

  • 另一个问题的类似答案:How to decide on port number between client and server communication on internet :

    Also, a client can connect to many servers on the same port. When the clients connect, they will use a random port on there end.

    Only the server needs to worry about using a free port, and the clients need to know what this port is else they will not be able to connect to your server.


  • 其他可能的帮助:
  • How to find number of ephemeral ports in use?
  • 关于client - OpenJMS - 客户端端口号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13921443/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com