Commit 2ecff0b2 authored by Youness Alaoui's avatar Youness Alaoui

Remove the socket factory from nice_agent_new

parent 2f3b3ca5
...@@ -68,7 +68,8 @@ struct _NiceAgent ...@@ -68,7 +68,8 @@ struct _NiceAgent
GObject parent; /**< gobject pointer */ GObject parent; /**< gobject pointer */
gboolean full_mode; /**< property: full-mode */ gboolean full_mode; /**< property: full-mode */
NiceUDPSocketFactory *socket_factory; /**< property: socket factory */ NiceUDPSocketFactory udp_socket_factory; /**< property: socket factory */
NiceUDPSocketFactory relay_socket_factory; /**< property: socket factory */
GTimeVal next_check_tv; /**< property: next conncheck timestamp */ GTimeVal next_check_tv; /**< property: next conncheck timestamp */
gchar *stun_server_ip; /**< property: STUN server IP */ gchar *stun_server_ip; /**< property: STUN server IP */
guint stun_server_port; /**< property: STUN server port */ guint stun_server_port; /**< property: STUN server port */
......
...@@ -55,9 +55,9 @@ ...@@ -55,9 +55,9 @@
#include <glib.h> #include <glib.h>
#include "stun/usages/bind.h"
#include "udp.h" #include "udp.h"
#include "udp-bsd.h"
#include "udp-turn.h"
#include "candidate.h" #include "candidate.h"
#include "component.h" #include "component.h"
#include "conncheck.h" #include "conncheck.h"
...@@ -79,8 +79,7 @@ G_DEFINE_TYPE (NiceAgent, nice_agent, G_TYPE_OBJECT); ...@@ -79,8 +79,7 @@ G_DEFINE_TYPE (NiceAgent, nice_agent, G_TYPE_OBJECT);
enum enum
{ {
PROP_SOCKET_FACTORY = 1, PROP_COMPATIBILITY = 1,
PROP_COMPATIBILITY,
PROP_MAIN_CONTEXT, PROP_MAIN_CONTEXT,
PROP_STUN_SERVER, PROP_STUN_SERVER,
PROP_STUN_SERVER_PORT, PROP_STUN_SERVER_PORT,
...@@ -188,14 +187,6 @@ nice_agent_class_init (NiceAgentClass *klass) ...@@ -188,14 +187,6 @@ nice_agent_class_init (NiceAgentClass *klass)
/* install properties */ /* install properties */
g_object_class_install_property (gobject_class, PROP_SOCKET_FACTORY,
g_param_spec_pointer (
"socket-factory",
"UDP socket factory",
"The socket factory used to create new UDP sockets",
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (gobject_class, PROP_MAIN_CONTEXT, g_object_class_install_property (gobject_class, PROP_MAIN_CONTEXT,
g_param_spec_pointer ( g_param_spec_pointer (
"main-context", "main-context",
...@@ -404,6 +395,9 @@ nice_agent_init (NiceAgent *agent) ...@@ -404,6 +395,9 @@ nice_agent_init (NiceAgent *agent)
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS | STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS |
STUN_AGENT_USAGE_USE_FINGERPRINT); STUN_AGENT_USAGE_USE_FINGERPRINT);
nice_udp_bsd_socket_factory_init (&agent->udp_socket_factory);
nice_udp_turn_socket_factory_init (&agent->relay_socket_factory);
agent->rng = nice_rng_new (); agent->rng = nice_rng_new ();
priv_generate_tie_breaker (agent); priv_generate_tie_breaker (agent);
...@@ -413,18 +407,15 @@ nice_agent_init (NiceAgent *agent) ...@@ -413,18 +407,15 @@ nice_agent_init (NiceAgent *agent)
/** /**
* nice_agent_new: * nice_agent_new:
* @factory: a NiceUDPSocketFactory used for allocating sockets
* *
* Create a new NiceAgent. * Create a new NiceAgent.
* *
* Returns: the new agent * Returns: the new agent
**/ **/
NICEAPI_EXPORT NiceAgent * NICEAPI_EXPORT NiceAgent *
nice_agent_new (NiceUDPSocketFactory *factory, nice_agent_new (GMainContext *ctx, NiceCompatibility compat)
GMainContext *ctx, NiceCompatibility compat)
{ {
NiceAgent *agent = g_object_new (NICE_TYPE_AGENT, NiceAgent *agent = g_object_new (NICE_TYPE_AGENT,
"socket-factory", factory,
"compatibility", compat, "compatibility", compat,
"main-context", ctx, "main-context", ctx,
NULL); NULL);
...@@ -446,10 +437,6 @@ nice_agent_get_property ( ...@@ -446,10 +437,6 @@ nice_agent_get_property (
switch (property_id) switch (property_id)
{ {
case PROP_SOCKET_FACTORY:
g_value_set_pointer (value, agent->socket_factory);
break;
case PROP_MAIN_CONTEXT: case PROP_MAIN_CONTEXT:
g_value_set_pointer (value, agent->main_context); g_value_set_pointer (value, agent->main_context);
break; break;
...@@ -512,10 +499,6 @@ nice_agent_set_property ( ...@@ -512,10 +499,6 @@ nice_agent_set_property (
switch (property_id) switch (property_id)
{ {
case PROP_SOCKET_FACTORY:
agent->socket_factory = g_value_get_pointer (value);
break;
case PROP_MAIN_CONTEXT: case PROP_MAIN_CONTEXT:
agent->main_context = g_value_get_pointer (value); agent->main_context = g_value_get_pointer (value);
break; break;
......
...@@ -123,8 +123,7 @@ struct _NiceAgentClass ...@@ -123,8 +123,7 @@ struct _NiceAgentClass
GType nice_agent_get_type (void); GType nice_agent_get_type (void);
NiceAgent * NiceAgent *
nice_agent_new (NiceUDPSocketFactory *factory, nice_agent_new (GMainContext *ctx, NiceCompatibility compat);
GMainContext *ctx, NiceCompatibility compat);
gboolean gboolean
nice_agent_add_local_address (NiceAgent *agent, NiceAddress *addr); nice_agent_add_local_address (NiceAgent *agent, NiceAddress *addr);
......
...@@ -276,8 +276,7 @@ NiceCandidate *discovery_add_local_host_candidate ( ...@@ -276,8 +276,7 @@ NiceCandidate *discovery_add_local_host_candidate (
/* note: candidate username and password are left NULL as stream /* note: candidate username and password are left NULL as stream
level ufrag/password are used */ level ufrag/password are used */
if (nice_udp_socket_factory_make (&agent->udp_socket_factory,
if (nice_udp_socket_factory_make (agent->socket_factory,
udp_socket, address)) { udp_socket, address)) {
priv_attach_stream_component_socket (agent, stream, component, priv_attach_stream_component_socket (agent, stream, component,
udp_socket); udp_socket);
......
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