summaryrefslogtreecommitdiffstats
path: root/src/socket/SocketListener.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/socket/SocketListener.hpp')
-rw-r--r--src/socket/SocketListener.hpp26
1 files changed, 24 insertions, 2 deletions
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 <http://www.gnu.org/licenses/>.
*/
+#include <sys/socket.h>
+
#include <string>
#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