Added socket read timeout to enable us to implement a periodic function run
(to ping, for instance).
Added buffer to read messages.  This is important because the read_exact() may
now return a timeout and lose the bytes already read.
Added a type to encapsulate every type error peer may encounter.