How to get remote client's IP and port number for UDP broadcasting?
How to get remote client's IP and port number for UDP broadcasting?
Postby ftdiyun » Wed Aug 10, 2016 10:14 am
Gor UDP broadcasting, how should we know where is the message received from? To implement recvfrom function, we need to know the client's IP address and port number. Can you suggest which API in the SDK can be used? Thanks.
Re: How to get remote client's IP and port number for UDP broadcasting?
Postby pratik » Wed Aug 10, 2016 10:33 am
Hello,
In the receive callback function, arg points to the corresponding espconn structure, so you should be able to access the connection related information from the structure when executing a receive callback and thus determine what action to take:
void espconn_recv_callback ( void *arg, char *pdata, unsigned short len )
In the receive callback function, arg points to the corresponding espconn structure, so you should be able to access the connection related information from the structure when executing a receive callback and thus determine what action to take:
void espconn_recv_callback ( void *arg, char *pdata, unsigned short len )
Who is online
Users browsing this forum: No registered users and 189 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.