- unsigned size = protocol.assemble(pkt, out_buf, buf_size);
- socket.write(out_buf, size);
+ unsigned size = protocol.serialize(pkt, out_buf, buf_size);
+ try
+ {
+ socket.write(out_buf, size);
+ }
+ catch(const std::exception &e)
+ {
+ good = false;
+ if(signal_error.empty())
+ throw;
+ signal_error.emit(e);
+ }