#include <cstring>
#include "communicator.h"
+#include "streamsocket.h"
using namespace std;
handshake_status = 1;
}
+void Communicator::send_data(unsigned size)
+{
+ if(!good)
+ throw sequence_error("connection aborted");
+ if(handshake_status!=2)
+ throw sequence_error("handshake incomplete");
+
+ try
+ {
+ socket.write(out_buf, size);
+ }
+ catch(const std::exception &e)
+ {
+ good = false;
+ if(signal_error.empty())
+ throw;
+ signal_error.emit(e);
+ }
+}
+
void Communicator::data_available()
{
if(!good)