[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] How to program UDP on lwIP?

From: Marko Repo
Subject: [lwip-users] How to program UDP on lwIP?
Date: Mon, 05 Sep 2005 20:21:58 +0300
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Hello everybody,

I'm in need to program a datagram-based application for the very first time in my life, and since I haven't found very good documentation how to perform this on lwIP stack, I've decided to seek advice once again from more experienced programmers; I've already had good experiences in seeking answers from here :)

Anyway, as I understand, usually initializing UDP socket is done somehow like this:

  serversocket = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
  server.sin_family = AF_INET;
  server.sin_port = htons( server_port );
  inet_aton( server_ip, & server.sin_addr );
.  // some other code here, and then calling eventually
wri_length = sendto( serversocket, server_msg, strlen ( server_msg ), 0, (struct sockaddr *) & server, sizeof ( server) );

But obviously it's not meant to be used like this in lwIP. The sendto( )-function described above hangs completely, and normal send doesn't either seem to do very well, because the peer server doesn't receive anything. Is this proper way or have I got it all
wrong? Or am I supposed to call functions defined in udp.c directly?

Best regards,
  M. Repo, Helsinki, Finland

reply via email to

[Prev in Thread] Current Thread [Next in Thread]