接受方如何得到发送方的ip和port?

解决方案 »

  1.   

    TidUDPServer 的OnUDPRead消息中的
    abinding.port//发送方端口
    abinding.ip//发送方IP
      

  2.   

    abinding.PeerIP//发送方IP
    abinding.PeerPort//发送方端口
    打错了。Specifies the address of the remote connection.property PeerIP: string;DescriptionPeerIP is a read-only String property that identifies the address of the computer on the remote connection. PeerIP can be a computer name, such as "
    wvnvm.wvnet.edu", or an IP address in dotted-decimal format, such as "
    129.71.2.4".PeerIP is used in conjunction with PeerPort to determine the association used to identify the remote connection endpoint.PeerIP is updated in SetPeer, and as a result of Accept, SendTo, and RecvFrom operations.
      

  3.   

    PeerIP可信
    PeerPort是系统分配的,也就是说可能每次都不一样.