Community
cancel
Showing results for 
Search instead for 
Did you mean: 
JJord1
Novice
1,766 Views

getaddrinfo error Device or resource busy

I am trying to run FreeCoap ( https://github.com/keith-cullen/FreeCoAP) to be able to communicate with COAP and DTLS on a Intel Galileo gen. 2 board. I have seen that out of the box tests compile and run correctly (as long as I have been able to test by now).

I have seen that it is prepared to run over IPv6. I am no expert on it, but I have seen that it has the value host configured as ::1, what I understand is the localhost. When I have tried to change it to IPv4, that is 127.0.0.1 or the actual IP address of the board I am getting errors.

I have seen that it uses netdb.h to create the server.

# include

...

# define HOST "127.0.0.1" /**< Host address to listen on */

# define PORT "12436"

...

unsigned char msg_id[2] = {0};

struct addrinfo hints = {0};

struct addrinfo *list = NULL;

struct addrinfo *node = NULL;

hints.ai_flags = 0;

hints.ai_family = AF_INET; /* value = 2 preferred socket domain */

hints.ai_socktype = SOCK_DGRAM; /* value = 3 preferred socket type */

hints.ai_protocol = 0; /* preferred protocol (3rd argument to socket()) - 0 specifies that any protocol will do */

hints.ai_addrlen = 0; /* must be 0 */

hints.ai_addr = NULL; /* must be NULL */

hints.ai_canonname = NULL; /* must be NULL */

hints.ai_next = NULL; /* must be NULL */

ret = getaddrinfo(HOST, PORT, &hints, &list);

As result of getaddrinfo what I get is a -16 value, indicating the following error:

Error : Device or resource busy

I have tried searchig with netstat -a and there is no such port in use.

What I am missing? What resource is busy and not allowing me to get the address?

0 Kudos
3 Replies
idata
Community Manager
215 Views

Hi Blasi,

 

 

Thanks for your interest in the Intel® Galileo Platform.

 

 

I have no experience using CoAP, so I was looking information related to it and I have found these implementations for multiple programming languages as well as server/client examples that I believe you could find useful information:

 

However, regarding the issue you are having I'd suggest you to contact FreeCoAP (http://www.freecoap.org/ http://www.freecoap.org/) since they could give you a more accurate answer.

 

 

Regards,

 

-Yermi

 

JJord1
Novice
215 Views

Hi Yemi,

Thanks for your response. I will try to contact them. I must admit I was not able to find their contact address (but found a reference about the developer working in Intel).

I have already managed to get COAP working with another project (microcoap). What FreeCoap claism to have resolved, and it is part of what I am trying to obtain, is the secure communication using the DTLS that the COAP RFC sets as standard. Looks like this secure comm is in the TODO list of almost every COAP project.

idata
Community Manager
215 Views

Hi Blasi,

 

 

You can send them an email using the email address that appears here: http://www.freecoap.org/ http://www.freecoap.org/ or you could open a new issue in their https://github.com/keith-cullen/FreeCoAP/issues?q=is:issue+is:closed GitHub page and post your questions.

 

 

Regards,

 

-Yermi

 

Reply