Add a level of inheritance above SocketHandler

SocketHandler has been renamed to TCPSocketHandler
SocketHandler is now a simple interface with a few methods, used only by
Poller.

This way we can inherite from the new SocketHandler class, to handle other
types of sockets, and still make them manageable by the poller without any
change in the Poller class.
This commit is contained in:
Florent Le Coz committed 2014-07-02 03:01:09 +02:00
1 parent b0ae8c66e3
commit 04d999168a
8 files changed
+332 -308

No files matched your search

+1 -1
View File
@@ -20,7 +20,7 @@ using namespace std::string_literals;
using namespace std::chrono_literals;
IrcClient::IrcClient(std::shared_ptr<Poller> poller, const std::string& hostname, const std::string& username, Bridge* bridge):
SocketHandler(poller),
TCPSocketHandler(poller),
hostname(hostname),
username(username),
current_nick(username),
+2 -2
View File
@@ -5,7 +5,7 @@
#include <irc/irc_channel.hpp>
#include <irc/iid.hpp>
#include <network/socket_handler.hpp>
#include <network/tcp_socket_handler.hpp>
#include <unordered_map>
#include <memory>
@@ -21,7 +21,7 @@ class Bridge;
* Represent one IRC client, i.e. an endpoint connected to a single IRC
* server, through a TCP socket, receiving and sending commands to it.
*/
class IrcClient: public SocketHandler
class IrcClient: public TCPSocketHandler
{
public:
explicit IrcClient(std::shared_ptr<Poller> poller, const std::string& hostname, const std::string& username, Bridge* bridge);