Increase receive timeout to 4 seconds and retry writing if incomplete.
Fix IN hexdump
Fix for prime packet format. 1) when receiving data, check packet sequence number. 2) when sending data, don't omit the last byte.