sending binary files to a 16 micro controller.

Nick Craig-Wood nick at craig-wood.com
Mon Aug 22 13:29:49 EDT 2005


Grant Edwards <grante at visi.com> wrote:
>  You have no control over packet size in TCP if you use the
>  normal socket interface.  About the only thing you can to is
>  put delays between calls to send() in hope that the TCP stack
>  will send a packet.

You can set the MTU (maximum transfer unit) for that interface.  You
do with with ifconfig under un*x - I expect windows has an interface
to do it too (perhaps ipconfig?)

For ethernet the MTU is 1500 bytes normally.

>  If you really do want control over packet size, you'll have to
>  use a raw socket and impliment TCP yourself.

Actually I'd recommend the OP uses UDP, not TCP.  I've implemented a
few systems which speak UDP directly and its very easy.  I wouldn't
like to implement TCP though!

-- 
Nick Craig-Wood <nick at craig-wood.com> -- http://www.craig-wood.com/nick



More information about the Python-list mailing list