Forums - socket creation error

3 posts / 0 new
Last post
socket creation error
Join Date: 25 Dec 19
Posts: 3
Posted: Tue, 2020-02-11 04:58


I'm trying to create socket client on QCA4020 device, 

the steps I follow:

  1. enable Wlan
  2. connect to router
  3. get IP from DHCP server

then after dhcp callback called, my attempt to call -> qapi_socket(AF_INET, SOCK_STREAM, 0) 

returns -1, so I cannot create a socket. 

Is there anything that I missed to initialize before creating socket?


  • Up0
  • Down0
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 244
Posted: Tue, 2020-02-11 09:56

Can you provide us your console log to verify the issue ?
Also, can you confirm if the same behaviour is seen with QCLI_demo when following the above mentioned steps ?

 wlan enable
 wlan setdevice 1
 wlan SetWpaPassphrase password
 wlan SetWpaParameters WPA2 CCMP CCMP
 wlan connect SSID

net dhcpv4c wlan1

net benchrx tcp 2390

  • Up0
  • Down0
Join Date: 25 Dec 19
Posts: 3
Posted: Thu, 2020-02-13 01:31

Thank you for reply.

I have corrected my code so it works without issues.

I will post a part of code later, maybe it will be useful for others.

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.