#include <cstring>
#include "communicator.h"
+using namespace std;
+
namespace {
using namespace Msp::Net;
if(!good)
return;
- in_end += socket.read(in_end, in_buf+buf_size-in_end);
try
{
+ in_end += socket.read(in_end, in_buf+buf_size-in_end);
+
bool more = true;
while(more)
{
}
}
}
- catch(...)
+ catch(const exception &e)
{
good = false;
- throw;
+ if(signal_error.empty())
+ throw;
+ signal_error.emit(e);
}
}
{
char *pkt = in_begin;
in_begin += psz;
- proto.disassemble(recv, pkt, psz);
+ proto.dispatch(recv, pkt, psz);
return true;
}
else
shake.hash = protocol.get_hash();
HandshakeProtocol hsproto;
- unsigned size = hsproto.assemble(shake, out_buf, buf_size);
+ unsigned size = hsproto.serialize(shake, out_buf, buf_size);
socket.write(out_buf, size);
}