What "errno==-1" indicates based on sendto fails?Every macro of errno is positive number from "errno.h".

roctwo
Posts: 95
Joined: Mon Nov 28, 2016 3:12 am

What "errno==-1" indicates based on sendto fails?Every macro of errno is positive number from "errno.h".

Postby roctwo » Sat Aug 05, 2017 6:14 am

Code: Select all

ret=sendto(sock,start,SEND_START_LEN,0,(struct sockaddr *)&toAddr,sizeof(toAddr))
if(ret<0)
{
   printf("errno is %d\n",errno);
}
else
{
   printf("send success\n");
}

Data transmission through wifi,using UDP.
Log is:errno is -1.
So my question is:What "errno==-1" indicates based on sendto fails.


User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: What "errno==-1" indicates based on sendto fails?Every macro of errno is positive number from "errno.h".

Postby kolban » Sat Aug 05, 2017 2:44 pm

This may be a duplicate thread ... see also:

https://esp32.com/viewtopic.php?f=2&t=2646
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Who is online

Users browsing this forum: YaCy [Bot] and 123 guests