summaryrefslogtreecommitdiffstats
path: root/message_handler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'message_handler.cpp')
-rw-r--r--message_handler.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/message_handler.cpp b/message_handler.cpp
index ef9eb06..e66e39c 100644
--- a/message_handler.cpp
+++ b/message_handler.cpp
@@ -163,7 +163,7 @@ uint32_t Handler::getCommand(Message& message)
return command;
}
-int Handler::send(Message& outMessage)
+void Handler::send(Message& outMessage)
{
auto session = (std::get<session::Manager&>(singletonPool).getSession(
sessionID)).lock();
@@ -171,15 +171,12 @@ int Handler::send(Message& outMessage)
// Flatten the packet
auto packet = parser::flatten(outMessage, sessionHeader, *session);
- // Read the packet
+ // Write the packet
auto writeStatus = channel->write(packet);
if (writeStatus < 0)
{
- std::cerr << "E> Error in writing : " << std::hex << writeStatus
- << "\n";
+ throw std::runtime_error("Error in writing to socket");
}
-
- return writeStatus;
}
void Handler::setChannelInSession() const
OpenPOWER on IntegriCloud