Page 1 of 1

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

Posted: Sat Aug 05, 2017 6:14 am
by roctwo

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.

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

Posted: Sat Aug 05, 2017 7:06 am
by WiFive

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

Posted: Sat Aug 05, 2017 2:44 pm
by kolban
This may be a duplicate thread ... see also:

https://esp32.com/viewtopic.php?f=2&t=2646