On Mon, Mar 05, 2007 at 07:40:35PM +0200, ?a?lar AKY?Z wrote: > Should I play with my lwIP options or should I review my linux network > programming knowledge? Moreover, can I investigate this problem using > Ethereal?
That's just the way TCP works - the units in which you write data bear no resemblance to the units you application at the other end will read data. The TCP protocol is free to chop and merge the data you give it as it likes, as long as it delivers it in the right order. Think of it as a stream of data rather than being packetised. If you want to get data in certain sized chunks, (e.g. to get a whole command) you have two choices. If you know the length of a chunk in advance, you can loop around read until you have enough (and keep any extra you get for the next read). Or, if the units you application sends in are variable length get it to first write the length of this chunk, followed by the chunk itself. Then your reading end can read the length first, and know how much to expect, and loop as before until it gets this much. The sockets API would take some of this hassle out for you, but in most cases you're better off with the raw API on lwIP. Kieran _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
