summaryrefslogtreecommitdiffstats
path: root/src/socket/SocketListener.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-09 16:06:59 +0000
committerDavid Robillard <d@drobilla.net>2012-05-09 16:06:59 +0000
commit6932da9169a38a5a8eafc63357b9ede00cb46117 (patch)
treef2a9d02d7c82c859db334dfcb3b6060cfc8bac07 /src/socket/SocketListener.hpp
parented80c779a6085ce62b9f61a28263607983db93a1 (diff)
downloadingen-6932da9169a38a5a8eafc63357b9ede00cb46117.tar.gz
ingen-6932da9169a38a5a8eafc63357b9ede00cb46117.tar.bz2
ingen-6932da9169a38a5a8eafc63357b9ede00cb46117.zip
Support TCP sockets.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4328 a436a847-0d15-0410-975c-d299462d15a1
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