wiced_tcp_create_socket sometimes fails

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

cross mob
MaFa_974161
Level 5
Level 5
100 sign-ins 50 replies posted 50 questions asked

Hello, I'm using CYW954907AEVAL1F.

 

I develop an app that listen and accept incoming TCP connections on WiFi.

 

Sometimes when I create socket I obtain error

 

MaFa_974161_0-1638261282041.png

result = 7

0 Likes
3 Replies
GauravS_31
Moderator
Moderator
Moderator
10 questions asked 250 solutions authored 250 sign-ins

Is it the netX error code? The error code 7 indicates NX_PTR_ERROR which is due to Invalid IP or socket pointer.  Is the WLAN interface in STA or AP mode? I presume the WLAN device had been associated first and then you called the wiced_tcp_create_socket ()? The failure could be because of DHCP bring up failure. Did you observe any IP address on the console logs after the association was successful?

0 Likes

Yes, it is the netX error code.

 

Wiced WLAN is configured as AP.

 

My Wiced application act as a server.

 

I develop an Android APP that open the TCP socket on Wiced and then,

when it detects the socket is closed (on the Wiced side) it reopens it as soon as possible.

 

I observe that when the socket is closed (on Wiced side) and the Android APP reopen it, 

the Wiced subsequently reclose socket and this situation generates a open/close/open/close/... "ballet" loop .

 

Using the debugger, after some cycle I observe the situation taken in screeshot.

 

I don't understand why ...

0 Likes

Hi @MaFa_974161 ,

Can you share the wireshark logs. We can check why wiced closes the TCP socket.

Thanks,

Rakesh BG

0 Likes