From 6932da9169a38a5a8eafc63357b9ede00cb46117 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 9 May 2012 16:06:59 +0000 Subject: Support TCP sockets. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4328 a436a847-0d15-0410-975c-d299462d15a1 --- src/socket/SocketListener.hpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'src/socket/SocketListener.hpp') diff --git a/src/socket/SocketListener.hpp b/src/socket/SocketListener.hpp index 10e9d1d2..6d70c78a 100644 --- a/src/socket/SocketListener.hpp +++ b/src/socket/SocketListener.hpp @@ -14,6 +14,8 @@ along with Ingen. If not, see . */ +#include + #include #include "raul/SharedPtr.hpp" @@ -33,12 +35,32 @@ public: SocketListener(Ingen::Shared::World& world); ~SocketListener(); + struct Socket { + Socket() : addr(NULL), addr_len(0), sock(-1) {} + ~Socket() { close(); } + + bool open(const std::string& uri, + int domain, + struct sockaddr* addr, + socklen_t addr_len); + + int accept(); + + void close(); + + std::string uri; + struct sockaddr* addr; + socklen_t addr_len; + int sock; + }; + private: virtual void _run(); Ingen::Shared::World& _world; - std::string _sock_path; - int _sock; + std::string _unix_path; + Socket _unix_sock; + Socket _net_sock; }; } // namespace Ingen -- cgit v1.2.1