diff options
author | Lennart Poettering <lennart@poettering.net> | 2004-06-19 18:41:24 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2004-06-19 18:41:24 +0000 |
commit | b4e3f5c5c5fb1cb0ddb10d123d69c211516c4ac7 (patch) | |
tree | 813cfda5a7c64504b366909fac532d36f0430426 /src/module-simple-protocol.c | |
parent | 56f8c953dd609bc5c94011fe4acdd9ef6b875747 (diff) |
add simple ptorocol with unix
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@25 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/module-simple-protocol.c')
-rw-r--r-- | src/module-simple-protocol.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/module-simple-protocol.c b/src/module-simple-protocol.c new file mode 100644 index 00000000..c25ff06a --- /dev/null +++ b/src/module-simple-protocol.c @@ -0,0 +1,29 @@ +#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); + +#ifdef USE_TCP_SOCKETS + if (!(s = socket_server_new_ipv4(c->mainloop, INADDR_LOOPBACK, 4712))) + return -1; +#else + if (!(s = socket_server_new_unix(c->mainloop, "/tmp/polypsimple"))) + return -1; +#endif + + 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); +} |