diff options
Diffstat (limited to 'src/Common')
-rw-r--r-- | src/Common/ClientConnection.cpp | 6 | ||||
-rw-r--r-- | src/Common/ClientConnection.h | 2 | ||||
-rw-r--r-- | src/Common/Connection.cpp | 6 | ||||
-rw-r--r-- | src/Common/Connection.h | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/Common/ClientConnection.cpp b/src/Common/ClientConnection.cpp index 0e080fd..7b33fb2 100644 --- a/src/Common/ClientConnection.cpp +++ b/src/Common/ClientConnection.cpp @@ -20,6 +20,8 @@ #include "ClientConnection.h" #include <Net/ClientConnection.h> +#include "Logger.h" + namespace Mad { namespace Common { @@ -27,8 +29,8 @@ ClientConnection::ClientConnection() : connection(new Net::ClientConnection) { connection->signalReceive().connect(sigc::mem_fun(this, &ClientConnection::receive)); } -void ClientConnection::send(const Net::Packet &packet) { - connection->send(packet); +bool ClientConnection::send(const Net::Packet &packet) { + return connection->send(packet); } void ClientConnection::connect(const Net::IPAddress &address, bool daemon) throw(Net::Exception) { diff --git a/src/Common/ClientConnection.h b/src/Common/ClientConnection.h index 28a7016..09ca4db 100644 --- a/src/Common/ClientConnection.h +++ b/src/Common/ClientConnection.h @@ -37,7 +37,7 @@ class ClientConnection : public Connection { Net::ClientConnection *connection; protected: - virtual void send(const Net::Packet &packet); + virtual bool send(const Net::Packet &packet); public: ClientConnection(); diff --git a/src/Common/Connection.cpp b/src/Common/Connection.cpp index cde3fc2..510731f 100644 --- a/src/Common/Connection.cpp +++ b/src/Common/Connection.cpp @@ -26,13 +26,11 @@ namespace Mad { namespace Common { void Connection::receive(const Net::Packet &packet) { - // receive() will be called by FdManager (main thread) - // -> let the ThreadManager call the handler in the worker thread signal(XmlPacket(packet), packet.getRequestId()); } -void Connection::sendPacket(const XmlPacket &packet, uint16_t requestId) { - send(packet.encode(requestId)); +bool Connection::sendPacket(const XmlPacket &packet, uint16_t requestId) { + return send(packet.encode(requestId)); } } diff --git a/src/Common/Connection.h b/src/Common/Connection.h index 7bcb92b..860c044 100644 --- a/src/Common/Connection.h +++ b/src/Common/Connection.h @@ -50,12 +50,12 @@ class Connection { void receive(const Net::Packet &packet); - virtual void send(const Net::Packet &packet) = 0; + virtual bool send(const Net::Packet &packet) = 0; public: virtual ~Connection() {} - void sendPacket(const XmlPacket &packet, uint16_t requestId); + bool sendPacket(const XmlPacket &packet, uint16_t requestId); sigc::signal<void, const XmlPacket&, uint16_t> signalReceive() const { return signal; |