Arduino Ethernet VNC Server

Null bytes? You mean packets containing 0x00, or you mean packets of length zero? I didn't realize the Ethernet library disallowed the former, and didn't realize TCP allowed the latter. :slight_smile:

I mean packet data containing 0x00. Unless you use the byte-at-time write method you can't send an array of bytes that contain 0x00 due to the current print-style handling of null bytes as string terminators.

As for buffering, sounds like you need a Nagle's Algorithm switch. If enabled, allow output buffering but a timer will send the current buffer if you don't explicitly flush() to send what you've built up.

Yeah, there's been some discussion on the Developer list that has included references to Nagle, although I think at a lower level than the example you give.

Not sure if using a timer is justified by the benefit or not...

--Phil.