On Mon, 22 Aug 2005, Grant Edwards wrote: > On 2005-08-22, Magnus Lycka <[EMAIL PROTECTED]> wrote: > >>> Hi, I'm working on a project were a need to be able to upload firmware >>> to a microcontroller based Ethernet device. But because of the memory >>> constraints the controller can only handle packages of 300 bytes each >>> time. So therefore the firmware file must be sent in chunks > > It's very probable that the TCP stack will combine chunks and > send out full Ethernet frames (4K bytes).
Those are *very* full ethernet frames! It seems to me that if the receiver can only handle a certain amount of data at a time, this should be reflected in its receive window; it should never advertise a bigger window than it can handle. if that's the case, the program should be able to write data as fast as it likes, as the sending TCP module will throttle it down so it goes out in right-sized drips. I'm not a TCP expert, though. Anyway, if you are going the small-writes route, make sure you set the TCP_NODELAY flag, to turn of Nagleing on the connection. I'm not sure if anyone mentioned that already. tom -- sh(1) was the first MOO -- http://mail.python.org/mailman/listinfo/python-list