UDP error

Thomas Rauscher trauscher at loytec.com
Thu Jul 8 11:52:26 UTC 2004


> -----Original Message-----
> From: Angelo Fraietta [mailto:afraiett at bigpond.net.au] 
> Sent: Thursday, July 08, 2004 11:51 AM
> To: RTEMS Users
> Subject: Re: UDP error
> 
> 
> 
> Angelo Fraietta wrote:
> 
> > 
> > Thomas Rauscher wrote:
> > 
> >>
> >> Error 105 is ENOBUFS. It is returned when mbufs are exhausted
> >> (from quite a lot places in the IP stack) or when the ethernet
> >> sending queue is full (default limit 50).
> >> I think it is one of these two problems.
> > 
> 
> In my program, I am sending all my data as broadcast messages to 
> 255.255.255.255
> 
> I don't ever read from the port as I am just sending UDP 
> messages. Could 
> this cause the overflow? At times, I don't think that would have even 
> been 50 messages sent.
> 

If this error occurs, try dumping the IP interface and mbuf statistics
to find out where the limit is.

rtems_bsdnet_show_if_stats();
rtems_bsdnet_show_mbuf_stats();

Did you set the SO_BROADCAST option on your sending socket?
I think I needed this: 

  int broadcast = 1;
  if(setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &broadcast,
sizeof(broadcast)) != 0)
  {
    printf("setsockopt failed: %s!\n", strerror(errno));
  }


Regards,
Thomas Rauscher

--
Thomas Rauscher
LOYTEC electronics GmbH
Stolzenthalergasse 24/3
A-1080 Wien
Austria/Europe
trauscher at loytec.com
www.loytec.com
Phone: +43-1-4020805-15
FAX:   +43-1-4020805-99




More information about the users mailing list