Home AMX User Forum NetLinx Studio
Options

How to get the random IP and port of the client and reply the message to the client?

tttttt Posts: 21

I would like to ask, my AMX NX-3200 Netlinx control program is like this.
IP_SERVER_OPEN(DV_master_4.Port,DV_master_4_Port,ip_udp)//98 square meters of control host as server
The AMX control host of the 98 square meters conference room is the server, and the server is udp port 8886. But I can only receive commands from other clients, how can I reply to the client? Because the port number is random when the client replies, how can my control get the random port of the client? And reply the message to the client?

Comments

  • richardhermanrichardherman Posts: 405
    edited May 25

    You have to use 'IP_CLIENT_OPEN' for that.
    If your server receives a message, the IP address and sourceport of the sender will be in the DATA.SOURCEIP and DATA.SOURCEPORT variables in the DATA_EVENT for your server

    IP_CLIENT_OPEN(dvClient,DATA.SOURCEIP,DATA.SOURCEPORT,IP_UDP)

    When using UDP it is not guaranteed that the client will expect or accept a response.

Sign In or Register to comment.