summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2014-09-29 00:58:55 +0200
committerChristian Pointner <equinox@spreadspace.org>2014-09-29 00:58:55 +0200
commit1f3bee08f3a63406464fa18b346bb6d95e8de68d (patch)
treeb8fa5d59bd8c333ebd4f35699e54dfc1af6f9b84 /src
parentrecording works now for receiver as well (diff)
initial support for keepalives
Diffstat (limited to 'src')
-rw-r--r--src/datatypes.h2
-rw-r--r--src/udp.c11
2 files changed, 12 insertions, 1 deletions
diff --git a/src/datatypes.h b/src/datatypes.h
index f60d97f..2ff5e12 100644
--- a/src/datatypes.h
+++ b/src/datatypes.h
@@ -39,6 +39,7 @@
#include <stdint.h>
#include <glib.h>
+#include <gio/gio.h>
#include <gst/gst.h>
#include <netdb.h>
@@ -75,6 +76,7 @@ struct udp_sources {
GstElement* rtp_audio_;
GstElement* rtcp_audio_;
int keepalive_interval_;
+ GInetAddress* remote_addr_;
};
#endif
diff --git a/src/udp.c b/src/udp.c
index 470df36..26d090f 100644
--- a/src/udp.c
+++ b/src/udp.c
@@ -230,13 +230,22 @@ gboolean attach_udpsinks(struct udp_sinks *sinks)
return TRUE;
}
+static gboolean send_keepalives(gpointer user_data)
+{
+ log_printf(WARNING, "sending keep alives is not yet supporet!");
+ return TRUE;
+}
gboolean attach_udpsources(struct udp_sources *sources)
{
if(!sources)
return FALSE;
- log_printf(WARNING, "udp source keep alive messages are not implemented yet!");
+ if(sources->keepalive_interval_ > 0) {
+ send_keepalives(sources);
+ if(!g_timeout_add_seconds(sources->keepalive_interval_, send_keepalives, sources))
+ return FALSE;
+ }
return TRUE;
}