lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] problems serving larger data with netconn_write()


From: Alan Lamphier
Subject: Re: [lwip-users] problems serving larger data with netconn_write()
Date: Thu, 12 Oct 2006 06:22:48 -0700 (PDT)

Andre Puschmann <address@hidden> writes:

> here is a code snippet:
> 
> for (ul_BytesSent = 0; ul_PackageSize < ul_BytesToSend; ul_BytesSent +=
> ul_PackageSize)
> {
>       netconn_write(  ps_newconn,
>                       pub_Image + ul_BytesSent,
>                       ul_PackageSize,
>                       NETCONN_NOCOPY);
> 
>       ul_BytesToSend-=ul_PackageSize;
> }
> /* send rest */
> ...

Is your image sotting in a constant array in ROM? - I didn't have any luck
when I tried to pass netconn_write() a pointer to ROM.  I chose a different
path and never resolved that problem.

I noticed you don't adjust the PackageSize for the last packet - most likely
the image size does not equal an even number of PackageSizes.  You should
include something like this (before netconn_write) to adjust the last
PackageSize...

        if ( (ul_BytesToSend-ul_BytesSent) < ul_PackageSize )
                ul_PackageSize = ul_BytesToSend-ul_BytesSent;

I attached an wireshark 
http://www.nabble.com/file/3611/Logo%20jpg%20load.pcap Logo jpg load.pcap
trace of a web page retrieval and image GET example, if it helps.  I've run
into the "TCP segment of a Reassembled PDU" sending POST data to my
hardware, but don't understand it enough to offer advice.

Regards,
Alan


-- 
View this message in context: 
http://www.nabble.com/problems-serving-larger-data-with-netconn_write%28%29-tf2425723.html#a6776009
Sent from the lwip-users mailing list archive at Nabble.com.





reply via email to

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