summaryrefslogtreecommitdiffstats
path: root/src/protocol-simple-tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol-simple-tcp.c')
-rw-r--r--src/protocol-simple-tcp.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/protocol-simple-tcp.c b/src/protocol-simple-tcp.c
new file mode 100644
index 00000000..e71d7142
--- /dev/null
+++ b/src/protocol-simple-tcp.c
@@ -0,0 +1,24 @@
+#include <assert.h>
+#include <arpa/inet.h>
+
+#include "module.h"
+#include "socket-server.h"
+#include "protocol-simple.h"
+
+int module_init(struct core *c, struct module*m) {
+ struct socket_server *s;
+ assert(c && m);
+
+ if (!(s = socket_server_new_ipv4(c->mainloop, INADDR_LOOPBACK, 4712)))
+ return -1;
+
+ m->userdata = protocol_simple_new(c, s, PROTOCOL_SIMPLE_PLAYBACK);
+ assert(m->userdata);
+ return 0;
+}
+
+void module_done(struct core *c, struct module*m) {
+ assert(c && m);
+
+ protocol_simple_free(m->userdata);
+}