- void send(const P &pkt)
- {
- if(!good)
- throw sequence_error("connection aborted");
- if(handshake_status!=2)
- throw sequence_error("handshaking not done");
- 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);
- }
- }