compatido: cleanup idosocket build, works now with conninfo db hello handshake, still TODO

This commit is contained in:
Michael Friedrich 2012-09-15 14:59:55 +02:00
parent 2c9ac33a32
commit 340a0583bf
2 changed files with 19 additions and 17 deletions

View File

@ -4,9 +4,11 @@ pkglib_LTLIBRARIES = \
compatido.la compatido.la
compatido_la_SOURCES = \ compatido_la_SOURCES = \
i2-compatido.h \
idosocket.cpp \
idosocket.h \
compatidocomponent.cpp \ compatidocomponent.cpp \
compatidocomponent.h \ compatidocomponent.h
i2-compatido.h
compatido_la_CPPFLAGS = \ compatido_la_CPPFLAGS = \
$(BOOST_CPPFLAGS) \ $(BOOST_CPPFLAGS) \

View File

@ -50,7 +50,7 @@ void IdoSocket::SendMessage(const String& message)
* as we inherit all the functionality * as we inherit all the functionality
* of the tcpclient class * of the tcpclient class
*/ */
Write(message, message.size()); Write(message.CStr(), message.GetLength());
} }
/** /**
@ -59,23 +59,23 @@ void IdoSocket::SendMessage(const String& message)
*/ */
void IdoSocket::DataAvailableHandler(void) void IdoSocket::DataAvailableHandler(void)
{ {
for (;;) { String sString;
string sString;
{ while (NetString::ReadStringFromIOQueue(this, &sString)) {
mutex::scoped_lock lock(GetMutex()); //std::cerr << "<< " << jsonString << std::endl;
if (!Netstring::ReadStringFromFIFO(GetRecvQueue(), &sString)) try {
return; // Value value = Value::Deserialize(jsonString);
}
// if (!value.IsObjectType<Dictionary>())
// throw_exception(invalid_argument("JSON-RPC message must be a dictionary."));
// OnNewMessage(GetSelf(), MessagePart(value));
} catch (const exception& ex) {
Logger::Write(LogCritical, "jsonrpc", "Exception while processing message from JSON-RPC client: " + String(ex.what()));
}
}
try {
//message = MessagePart(jsonString);
//OnNewMessage(GetSelf(), message);
} catch (const exception& ex) {
Logger::Write(LogCritical, "idosocket", "Exception while processing message from idosocket client: " + string(ex.what()));
}
}
} }
/** /**