diff --git a/include/sp/extensions/tcp/TcpListener.h b/include/sp/extensions/tcp/TcpListener.h index 98ed8bb..07e2e06 100644 --- a/include/sp/extensions/tcp/TcpListener.h +++ b/include/sp/extensions/tcp/TcpListener.h @@ -10,6 +10,8 @@ namespace io { */ class TcpListener : private NonCopyable { public: + using SocketHandle = TcpTag::SocketHandle; + /** * \brief Starts listening for guests to connect * \param port The port to listen to diff --git a/include/sp/extensions/tcp/TcpSocket.h b/include/sp/extensions/tcp/TcpSocket.h index 1b14f3f..2ec39d3 100644 --- a/include/sp/extensions/tcp/TcpSocket.h +++ b/include/sp/extensions/tcp/TcpSocket.h @@ -6,9 +6,9 @@ namespace sp { namespace io { -using SocketHandle = int; - -struct TcpTag {}; +struct TcpTag { + using SocketHandle = int; +}; class SocketError : public std::exception { private: @@ -25,6 +25,8 @@ class SocketError : public std::exception { template <> class IOInterface : private NonCopyable { public: + using SocketHandle = TcpTag::SocketHandle; + /** * \enum Status * \brief Describes the state of a socket