lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] Data waiting but no recv()


From: Josh Rothstein
Subject: RE: [lwip-users] Data waiting but no recv()
Date: Mon, 21 Jan 2008 18:16:15 -0800

Those are my latest options, and it seems to working just fine.  I guess the
problem was a window of 1500 was too large?

Sorry for the mailbox flood.

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of Josh
Rothstein
Sent: Monday, January 21, 2008 6:13 PM
To: 'Mailing list for lwIP users'
Subject: RE: [lwip-users] Data waiting but no recv()

Just for more info, my TCP options in lwipopts.h are:

/* ---------- TCP options ---------- */
#define LWIP_TCP                1
#define TCP_TTL                 255
/* TCP receive window. */
#define TCP_WND                 1024
/* Controls if TCP should queue segments that arrive out of
   order. Define to 0 if your device is low on memory. */
#define TCP_QUEUE_OOSEQ         1

/* TCP Maximum segment size. */
#define TCP_MSS                 1024

/* TCP sender buffer space (bytes). */
#define TCP_SND_BUF             2048

/* TCP sender buffer space (pbufs). This must be at least = 2 *
   TCP_SND_BUF/TCP_MSS for things to work. */
#define TCP_SND_QUEUELEN        6 * TCP_SND_BUF/TCP_MSS



/* Maximum number of retransmissions of data segments. */
#define TCP_MAXRTX              12

/* Maximum number of retransmissions of SYN segments. */
#define TCP_SYNMAXRTX           4

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of Josh
Rothstein
Sent: Monday, January 21, 2008 5:52 PM
To: 'Mailing list for lwIP users'
Subject: RE: [lwip-users] Data waiting but no recv()

This is running on an AVR32 with 64k of RAM. 

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Jonathan Larmour
Sent: Monday, January 21, 2008 5:46 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] Data waiting but no recv()

Josh Rothstein wrote:
> Is there a better alternative if I am using version 1.2.0.?

Upgrade to 1.3.0-RC1? :).

You could try and backport Frederic's patch:
https://savannah.nongnu.org/task/?func=detailitem&item_id=7421

Otherwise there's what I said in my first paragraph.

Although it's occurred to me, is this TCP or UDP? If it's TCP you should 
instead be tuning the value of the receiver TCP window (TCP_WND). This is 
already pretty low at 2k by default, but I guess you might have increased 
it by accident. You can only increase it if you can be sure you have 
enough memory for it! :)

Jifl

> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On Behalf Of
> Jonathan Larmour
> Sent: Monday, January 21, 2008 5:26 PM
> To: Mailing list for lwIP users
> Cc: 'Campanella, David'; 'John Zigrang'
> Subject: Re: [lwip-users] Data waiting but no recv()
> 
> Josh Rothstein wrote:
> 
>>What is the correct way to make sure that my stack does not lock up if I 
>>am receiving unexpected data over a connection?  Should I just poll() 
>>each time around the loop?  I cannot just place extra recv()s around the 
>>loop or else my task will block if no data is waiting.
> 
> 
> Theoretically, you can do it in a different task, use select() to wait for

> multiple sockets when you would be blocked waiting for input anyway and/or

> use non-blocking sockets if you were going to be doing a busy poll anyway.
> 
> But the more efficient choice is to enable the LWIP_SO_RCVBUF option in 
> lwipopts.h and use setsockopt() to set it.
> 
> Jifl


-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["The best things in life aren't things."]------      Opinions==mine


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users



_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users



_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users





reply via email to

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