Using wiced_wifi_scan_networks() with multiple sockets

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,

I have created an HTTP server which uses multiple asynchronous TCP sockets such that there is always one TCP socket that is listening for a new connection attempt.  My issue occurs in both 2.4.0 and 2.4.1 with my SN8200 EVK.

The issue I'm having arises when I am using wiced_wifi_scan_networks() and there is a request for a connection (my web browser likes to send another TCP connection request immediately after sending the HTTP request that initiates the scan).  Once this happens, I never enter my results_handler function.

My scanning code is essentially the same as process_scan() in ../Wiced/internal/config_http_content.c, however I pass in a socket instead of a stream and create the stream inside of process_scan()  (I don't deinit the stream until the very end of process_scan()).

Is this a problem that has been seen before?

Thank you.

0 Likes
1 Solution
Anonymous
Not applicable

In what thread is your asynchronous TCP event processing occurring?

All scan results are processed by the network worker thread and if that thread is blocked your scan handler will not be called.

View solution in original post

0 Likes
4 Replies
Anonymous
Not applicable

In what thread is your asynchronous TCP event processing occurring?

All scan results are processed by the network worker thread and if that thread is blocked your scan handler will not be called.

0 Likes
Anonymous
Not applicable

I am not precisely sure of the thread, but I use wiced_tcp_register_callbacks as shown in the tcp_server_async snip, so I would assume it does use the network worker thread.

0 Likes

Hello,

Is there a follow up question or more information needed?

0 Likes
Anonymous
Not applicable

No more questions, my TCP events were running on the network worker thread, so I had to change the thread of the TCP events. Scanning works well now.