lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Output fails when output size exceeds 14KB while using sock


From: dipswitch
Subject: [lwip-users] Output fails when output size exceeds 14KB while using sockets
Date: Tue, 17 Jan 2012 23:38:00 +0800 (MYT)
User-agent: SquirrelMail/1.4.9a

Good evening,

Is there any reason why I need to fragment the outgoing packet myself? I
guess it has something to do with the memory allocation but I can't put my
finger on it.

If I set TCP_BLOCKS_SIZE in the code below to KB(14) I receive the data I
requested on the client side, however if I set TCP_BLOCK_SIZE to KB(15) I
won't get any of the requested data or an assertion.

#define KB(x)                           (1024 * (x))
#define TCP_BLOCK_SIZE                  KB(14)
#if 1
                // send the content in blocks
                for (; wrote >= 0 && idx < length; idx += wrote)
                        wrote = write(m_nSocket, (buffer + idx), ((length - 
idx) >=
TCP_BLOCK_SIZE) ? TCP_BLOCK_SIZE : (length - idx));
#else
                idx = write(m_nSocket, buffer, length);
#endif

Attachment: lwipopts.h
Description: Text document


reply via email to

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