[En-Nut-Discussion] How to use UDP sockets

Hugo Simon hugo.simon at gmx.de
Mon Jul 7 06:49:32 CEST 2003


Hi,

the DOS part seems ok now, but the Ethernut simply ignores my UDP packets,
take a look at my code to see whats wrong.
I looked at the source of NutUdpReceiveFrom, and it seems that I don't need
to _give_ the IP adress of the sender but I receive it from the function, as
is the port adress. But nothing happens, I am running into timeouts.

Thank you
Thorsten


THREAD(udpReceiver,arg)
{
  UDPSOCKET *udpsock;
  u_long  addr;
  u_short port=4950;
  int     size;
  static char bufr[4096];

  if ((udpsock=NutUdpCreateSocket(0)))
  {
   for (;;)
   {
    size=NutUdpReceiveFrom(udpsock, &addr, &port, bufr, 4096, 1000);
    if (size>0)
     printf("%i Bytes received from %s:%i\n",size, inet_ntoa(addr),port);
    else
      if (size==0) putchar('T');
      else putchar('.');
   }
  }
  else
    puts("Creation of UDP socket failed");
  for (;;);
}





----- Original Message -----
From: Hugo Simon <hugo.simon at gmx.de>
To: <en-nut-discussion at egnite.de>
Sent: Sunday, July 06, 2003 2:17 PM
Subject: [En-Nut-Discussion] How to use UDP sockets


> Hi!
>
> Can anyone help me. Since the senders are DOS computers running WATTCP
some
> info on that part is also interesting, you may send it private if it is
> offtopic here.
>
> Thank you
> Thorsten
>





More information about the En-Nut-Discussion mailing list