JSON serialization method in esdoc. TcpWriter emptying incoming buffer and noticing closed sockets on read instead of broken pipe on write.