Ejemplo n.º 1
0
static VALUE
socketservice_stop(VALUE self)
{
        g_socket_service_stop(_SELF(self));

        return self;
}
static gboolean
g_threaded_socket_service_incoming (GSocketService    *service,
                                    GSocketConnection *connection,
                                    GObject           *source_object)
{
  GThreadedSocketService *threaded;
  GThreadedSocketServiceData *data;

  threaded = G_THREADED_SOCKET_SERVICE (service);

  data = g_slice_new (GThreadedSocketServiceData);
  data->service = g_object_ref (service);
  data->connection = g_object_ref (connection);
  if (source_object)
    data->source_object = g_object_ref (source_object);
  else
    data->source_object = NULL;

  G_LOCK (job_count);
  if (++threaded->priv->job_count == threaded->priv->max_threads)
    g_socket_service_stop (service);
  G_UNLOCK (job_count);

  g_thread_pool_push (threaded->priv->thread_pool, data, NULL);



  return FALSE;
}
 RendStreamer::~RendStreamer(){
     g_socket_service_stop (this->service);
     g_object_unref (this->service);
     gst_element_set_state (pipeline, GST_STATE_NULL);
     gst_object_unref (pipeline);
     g_main_loop_unref (this->loop);          
 }
Ejemplo n.º 4
0
static void net_removeTCPSocketListener(struct node *n, guint classid)
{
    g_socket_service_stop(n->tcpsockets[classid].socketservice);
    g_socket_listener_close(
            G_SOCKET_LISTENER(n->tcpsockets[classid].socketservice));
    g_object_unref(n->tcpsockets[classid].socketservice);
    //FIXME: unref address results in segfault?
    //g_object_unref(sa); 

}
Ejemplo n.º 5
0
void
gum_duk_debug_server_free (GumDukDebugServer * self)
{
  gum_script_backend_set_debug_message_handler (self->backend, NULL, NULL,
      NULL);

  g_hash_table_unref (self->channels);

  g_socket_service_stop (self->service);
  g_object_unref (self->service);

  g_slice_free (GumDukDebugServer, self);
}
Ejemplo n.º 6
0
int
identd_plugin_deinit (void)
{
    if (service)
    {
        g_socket_service_stop (service);
        g_object_unref (service);
    }

    g_hash_table_destroy (responses);

    return 1;
}
Ejemplo n.º 7
0
Archivo: evp.c Proyecto: worr/eventd
static void
_eventd_evp_stop(EventdPluginContext *service)
{
#ifdef ENABLE_AVAHI
    eventd_evp_avahi_stop(service->avahi);
#endif /* ENABLE_AVAHI */

    g_slist_free_full(service->clients, _eventd_service_client_disconnect);

    g_socket_service_stop(service->service);
    g_socket_listener_close(G_SOCKET_LISTENER(service->service));
    g_object_unref(service->service);
}
Ejemplo n.º 8
0
/**
 * g_dbus_server_stop:
 * @server: A #GDBusServer.
 *
 * Stops @server.
 *
 * Since: 2.26
 */
void
g_dbus_server_stop (GDBusServer *server)
{
  g_return_if_fail (G_IS_DBUS_SERVER (server));
  if (!server->active)
    return;
  /* Right now we don't have any transport not using the listener... */
  g_assert (server->is_using_listener);
  g_assert (server->run_signal_handler_id > 0);
  g_signal_handler_disconnect (server->listener, server->run_signal_handler_id);
  server->run_signal_handler_id = 0;
  g_socket_service_stop (G_SOCKET_SERVICE (server->listener));
  server->active = FALSE;
  g_object_notify (G_OBJECT (server), "active");
}
Ejemplo n.º 9
0
static void owr_image_server_finalize(GObject *object)
{

    OwrImageServer *renderer = OWR_IMAGE_SERVER(object);
    OwrImageServerPrivate *priv = renderer->priv;

    g_socket_service_stop(priv->socket_service);
    g_object_unref(priv->socket_service);

    g_mutex_lock(&priv->image_renderers_mutex);
    g_hash_table_destroy(priv->image_renderers);
    g_mutex_unlock(&priv->image_renderers_mutex);
    g_mutex_clear(&priv->image_renderers_mutex);

    G_OBJECT_CLASS(owr_image_server_parent_class)->finalize(object);
}
Ejemplo n.º 10
0
void net_removeSockets(struct node *n)
{
    avahi_removeServices(n);
    syslog(LOG_DEBUG,"net_removeSockets: Closing sockets of node %s\n",n->id);

    guint i;
    for(i=0; i<sizeof(n->classes); i++){
        if( n->classes[i] != 0 ){
            net_removeUDPSocket(n, i);
            net_removeTCPSocketListener(n, i);
        }
    }
    
    g_socket_service_stop(n->mgtsocket.socketservice);
    g_socket_listener_close(G_SOCKET_LISTENER(n->mgtsocket.socketservice));
    g_object_unref(n->mgtsocket.socketservice);
}
Ejemplo n.º 11
0
void
dasom_server_stop (DasomServer *server)
{
  g_debug (G_STRLOC ": %s", G_STRFUNC);

  g_return_if_fail (DASOM_IS_SERVER (server));

  if (!server->active)
    return;

  g_assert (server->is_using_listener);
  g_assert (server->run_signal_handler_id > 0);

  g_signal_handler_disconnect (server->listener, server->run_signal_handler_id);
  server->run_signal_handler_id = 0;

  g_socket_service_stop (G_SOCKET_SERVICE (server->listener));
  server->active = FALSE;
}
Ejemplo n.º 12
0
static int
identd_command_cb (char *word[], char *word_eol[], void *userdata)
{
	g_return_val_if_fail (responses != NULL, HEXCHAT_EAT_ALL);

	if (!g_strcmp0 (word[2], "reload"))
	{
		if (service)
		{
			g_socket_service_stop (service);
			g_clear_object (&service);
		}

		identd_start_server ();

		if (service)
			return HEXCHAT_EAT_ALL;
	}

	if (service == NULL) /* If we are not running plugins can handle it */
		return HEXCHAT_EAT_HEXCHAT;

	if (word[2] && *word[2] && word[3] && *word[3])
	{
		guint64 port = g_ascii_strtoull (word[2], NULL, 0);

		if (port && port <= G_MAXUINT16)
		{
			g_hash_table_insert (responses, GINT_TO_POINTER (port), g_strdup (word[3]));
			/* Automatically remove entry after 30 seconds */
			hexchat_hook_timer (ph, 30000, identd_cleanup_response_cb, GINT_TO_POINTER (port));
		}
	}
	else
	{
		hexchat_command (ph, "HELP IDENTD");
	}

	return HEXCHAT_EAT_ALL;
}
Ejemplo n.º 13
0
int
main (int argc, char *argv[])
{
	GMainLoop *main_loop = NULL;
	HevSocks5Service *service = NULL;

	main_loop = g_main_loop_new (NULL, FALSE);

	service = hev_socks5_service_new (20);
	GInetAddress *iaddr = g_inet_address_new_from_string ("127.0.0.1");
	GSocketAddress *saddr = g_inet_socket_address_new (iaddr, 1082);
	if (g_socket_listener_add_address (G_SOCKET_LISTENER (service),
					saddr, G_SOCKET_TYPE_STREAM, G_SOCKET_PROTOCOL_TCP,
					NULL, NULL, NULL)) {
		g_socket_service_start (G_SOCKET_SERVICE (service));
		g_main_loop_run (main_loop);
		g_socket_service_stop (G_SOCKET_SERVICE (service));
	}

	g_object_unref (service);
	g_main_loop_unref (main_loop);

	return 0;
}
static void
tp_stream_tube_channel_dispose (GObject *obj)
{
  TpStreamTubeChannel *self = (TpStreamTubeChannel *) obj;

  if (self->priv->service != NULL)
    {
      g_socket_service_stop (self->priv->service);

      tp_clear_object (&self->priv->service);
    }

  tp_clear_object (&self->priv->result);
  tp_clear_pointer (&self->priv->parameters, g_hash_table_unref);

  g_slist_foreach (self->priv->conn_waiting_sig, (GFunc) conn_waiting_sig_free,
      NULL);
  tp_clear_pointer (&self->priv->conn_waiting_sig, g_slist_free);

  g_slist_foreach (self->priv->sig_waiting_conn, (GFunc) sig_waiting_conn_free,
      NULL);
  tp_clear_pointer (&self->priv->sig_waiting_conn, g_slist_free);

  if (self->priv->tube_connections != NULL)
    {
      GHashTableIter iter;
      gpointer conn;

      g_hash_table_iter_init (&iter, self->priv->tube_connections);
      while (g_hash_table_iter_next (&iter, NULL, &conn))
        {
          g_object_weak_unref (conn, remote_connection_destroyed_cb, self);
        }

      g_hash_table_unref (self->priv->tube_connections);
      self->priv->tube_connections = NULL;
    }

  if (self->priv->address != NULL)
    {
#ifdef HAVE_GIO_UNIX
      /* check if we need to remove the temporary file we created */
      if (G_IS_UNIX_SOCKET_ADDRESS (self->priv->address))
        {
          const gchar *path;

          path = g_unix_socket_address_get_path (
              G_UNIX_SOCKET_ADDRESS (self->priv->address));
          g_unlink (path);
        }
#endif /* HAVE_GIO_UNIX */

      g_object_unref (self->priv->address);
      self->priv->address = NULL;
    }

  tp_clear_pointer (&self->priv->access_control_param, tp_g_value_slice_free);
  tp_clear_object (&self->priv->local_conn_waiting_id);
  tp_clear_object (&self->priv->client_socket);

  G_OBJECT_CLASS (tp_stream_tube_channel_parent_class)->dispose (obj);
}
Ejemplo n.º 15
-1
void xr_server_stop(xr_server* server)
{
  xr_trace(XR_DEBUG_SERVER_TRACE, "(server=%p)", server);

  g_return_if_fail(server != NULL);

  g_socket_service_stop(G_SOCKET_SERVICE(server->service));
  g_main_loop_quit(server->loop);
}