Commit 6ad5b7c6 authored by Youness Alaoui's avatar Youness Alaoui

Port agent tests to the new NiceSocket API

parent 35192613
...@@ -86,15 +86,13 @@ main (void) ...@@ -86,15 +86,13 @@ main (void)
g_main_loop_get_context (loop), recv_cb, GUINT_TO_POINTER (42)); g_main_loop_get_context (loop), recv_cb, GUINT_TO_POINTER (42));
{ {
NiceUDPSocket *sock;
NiceCandidate *candidate; NiceCandidate *candidate;
GSList *candidates; GSList *candidates;
candidates = nice_agent_get_local_candidates (agent, 1, 1); candidates = nice_agent_get_local_candidates (agent, 1, 1);
candidate = candidates->data; candidate = candidates->data;
sock = candidate->sockptr;
nice_udp_socket_send (sock, &(candidate->addr), 6, "\x80hello"); nice_socket_send (candidate->sockptr, &(candidate->addr), 6, "\x80hello");
g_slist_free (candidates); g_slist_free (candidates);
} }
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#include <unistd.h> #include <unistd.h>
#include <nice/nice.h> #include <nice/nice.h>
#include "udp.h"
static gboolean cb_called = FALSE; static gboolean cb_called = FALSE;
...@@ -73,7 +72,7 @@ main (void) ...@@ -73,7 +72,7 @@ main (void)
{ {
NiceAgent *agent; NiceAgent *agent;
NiceAddress addr; NiceAddress addr;
NiceUDPSocket *sock; NiceSocket *sock;
gint pipe_fds[2]; gint pipe_fds[2];
GSList *fds = NULL; GSList *fds = NULL;
GSList *readable; GSList *readable;
...@@ -132,7 +131,7 @@ main (void) ...@@ -132,7 +131,7 @@ main (void)
/* send fake data */ /* send fake data */
nice_udp_socket_send (sock, &addr, 7, "\x80lalala"); nice_socket_send (sock, &addr, 7, "\x80lalala");
/* poll again */ /* poll again */
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#include <string.h> #include <string.h>
#include "udp.h"
#include "agent.h" #include "agent.h"
int int
...@@ -66,7 +65,6 @@ main (void) ...@@ -66,7 +65,6 @@ main (void)
{ {
NiceCandidate *candidate; NiceCandidate *candidate;
NiceUDPSocket *sock;
guint len; guint len;
gchar buf[1024]; gchar buf[1024];
GSList *candidates; GSList *candidates;
...@@ -74,8 +72,7 @@ main (void) ...@@ -74,8 +72,7 @@ main (void)
candidates = nice_agent_get_local_candidates (agent, stream_id, 1); candidates = nice_agent_get_local_candidates (agent, stream_id, 1);
candidate = candidates->data; candidate = candidates->data;
g_slist_free (candidates); g_slist_free (candidates);
sock = candidate->sockptr; nice_socket_send (candidate->sockptr, &candidate->addr, 7, "\x80lalala");
nice_udp_socket_send (sock, &candidate->addr, 7, "\x80lalala");
len = nice_agent_recv (agent, stream_id, len = nice_agent_recv (agent, stream_id,
candidate->component_id, 1024, buf); candidate->component_id, 1024, buf);
g_assert (len == 7); g_assert (len == 7);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment