lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] lwip_sendto hanging with lwip 2.0


From: Neerav Patel
Subject: [lwip-users] lwip_sendto hanging with lwip 2.0
Date: Tue, 24 Jan 2017 23:00:32 +0000

Hi


I am able to send packets via lwip_sendto in the main thread that I created.


What I then wanted to do was to use a timer in the main thread, using sys_timeout function to then do the sendout with the timer expires.  When I do this lwip_sendto just hangs there and I cant receive any packets or send any subsequent packets.


As mentioned previously, if I move the lwip_sendto to the main loop everything works fine again.  What could be causing this?


Placed below is a simplified version of what I am trying to do.


static void
send_actual_pkt( void * args )
{
      uint8_t pkt[576];

      // ... populate the pkt
      uint16_t len = generate_pkt();

      if ( lwip_sendto( s, pkt, len, 0, (struct sockaddr *)&from, sizeof(from) ) != len )   <---- hanging here!!!!
      {
         uart_printf( "Didnt send correctly %x\n", len );
      }
}


while( 1 )
   {
      if ( (lwip_recvfrom(s, raw_buf, sizeof(raw_buf), 0, (struct sockaddr*)&from, (socklen_t*)&fromlen)) > 0 )
      {
                  sys_timeout( ms, send_actual_pkt, NULL );
      }
   }

Thanks in advance.


reply via email to

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