loudmouth/lm-socket.c
author Mikael Hallendal <micke@imendio.com>
Tue, 08 Jul 2008 00:57:01 +0300
changeset 432 63a049d146c3
child 433 2ed69f025f4a
permissions -rw-r--r--
Added basic API for the new LmSocket
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
432
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     2
/*
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     3
 * Copyright (C) 2008 Imendio AB
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     4
 *
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     6
 * modify it under the terms of the GNU Lesser General Public License as
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     7
 * published by the Free Software Foundation; either version 2 of the
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     8
 * License, or (at your option) any later version.
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     9
 *
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    13
 * Lesser General Public License for more details.
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    14
 *
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    15
 * You should have received a copy of the GNU Lesser General Public
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    16
 * License along with this program; if not, write to the
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    17
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    18
 * Boston, MA 02111-1307, USA.
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    19
 */
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    20
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    21
#include <config.h>
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    22
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    23
#include "lm-marshal.h"
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    24
#include "lm-socket.h"
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    25
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    26
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), LM_TYPE_DUMMY, LmSocketPriv))
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    27
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    28
typedef struct LmSocketPriv LmSocketPriv;
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    29
struct LmSocketPriv {
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    30
	gint my_prop;
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    31
};
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    32
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    33
static void     socket_finalize            (GObject           *object);
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    34
static void     socket_get_property        (GObject           *object,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    35
					   guint              param_id,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    36
					   GValue            *value,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    37
					   GParamSpec        *pspec);
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    38
static void     socket_set_property        (GObject           *object,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    39
					   guint              param_id,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    40
					   const GValue      *value,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    41
					   GParamSpec        *pspec);
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    42
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    43
G_DEFINE_TYPE (LmSocket, lm_socket, G_TYPE_OBJECT)
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    44
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    45
enum {
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    46
	PROP_0,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    47
	PROP_MY_PROP
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    48
};
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    49
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    50
enum {
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    51
	SIGNAL_NAME,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    52
	LAST_SIGNAL
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    53
};
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    54
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    55
static guint signals[LAST_SIGNAL] = { 0 };
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    56
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    57
static void
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    58
lm_socket_class_init (LmSocketClass *class)
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    59
{
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    60
	GObjectClass *object_class = G_OBJECT_CLASS (class);
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    61
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    62
	object_class->finalize     = socket_finalize;
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    63
	object_class->get_property = socket_get_property;
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    64
	object_class->set_property = socket_set_property;
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    65
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    66
	g_object_class_install_property (object_class,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    67
					 PROP_MY_PROP,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    68
					 g_param_spec_string ("my-prop",
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    69
							      "My Prop",
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    70
							      "My Property",
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    71
							      NULL,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    72
							      G_PARAM_READWRITE));
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    73
	
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    74
	signals[SIGNAL_NAME] = 
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    75
		g_signal_new ("signal-name",
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    76
			      G_OBJECT_CLASS_TYPE (object_class),
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    77
			      G_SIGNAL_RUN_LAST,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    78
			      0,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    79
			      NULL, NULL,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    80
			      lm_marshal_VOID__INT,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    81
			      G_TYPE_NONE, 
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    82
			      1, G_TYPE_INT);
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    83
	
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    84
	g_type_class_add_private (object_class, sizeof (LmSocketPriv));
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    85
}
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    86
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    87
static void
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    88
lm_socket_init (LmSocket *dummy)
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    89
{
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    90
	LmSocketPriv *priv;
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    91
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    92
	priv = GET_PRIV (dummy);
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    93
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    94
}
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    95
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    96
static void
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    97
socket_finalize (GObject *object)
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    98
{
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    99
	LmSocketPriv *priv;
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   100
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   101
	priv = GET_PRIV (object);
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   102
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   103
	(G_OBJECT_CLASS (lm_socket_parent_class)->finalize) (object);
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   104
}
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   105
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   106
static void
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   107
socket_get_property (GObject    *object,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   108
		   guint       param_id,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   109
		   GValue     *value,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   110
		   GParamSpec *pspec)
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   111
{
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   112
	LmSocketPriv *priv;
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   113
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   114
	priv = GET_PRIV (object);
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   115
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   116
	switch (param_id) {
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   117
	case PROP_MY_PROP:
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   118
		g_value_set_int (value, priv->my_prop);
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   119
		break;
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   120
	default:
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   121
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   122
		break;
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   123
	};
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   124
}
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   125
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   126
static void
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   127
socket_set_property (GObject      *object,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   128
                     guint         param_id,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   129
                     const GValue *value,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   130
                     GParamSpec   *pspec)
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   131
{
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   132
	LmSocketPriv *priv;
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   133
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   134
	priv = GET_PRIV (object);
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   135
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   136
	switch (param_id) {
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   137
	case PROP_MY_PROP:
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   138
		priv->my_prop = g_value_get_int (value);
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   139
		break;
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   140
	default:
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   141
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   142
		break;
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   143
	};
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   144
}
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   145
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   146
LmSocket *
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   147
lm_socket_new (const gchar *host, guint port)
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   148
{
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   149
        return NULL;
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   150
}
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   151
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   152
/* Use DNS lookup to find the port and the host */
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   153
LmSocket *
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   154
lm_socket_new_srv (const gchar *service)
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   155
{
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   156
        return NULL;
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   157
}
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   158
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   159
void 
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   160
lm_socket_connect (LmSocket *socket)
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   161
{
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   162
        /* Initiate the connection process                 */
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   163
        /* DNS lookup, connect thing, create IOchannel etc */
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   164
}
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   165
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   166
gboolean
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   167
lm_socket_write (LmSocket *socket,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   168
                 gchar    *data,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   169
                 gsize     len)
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   170
{
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   171
        return FALSE;
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   172
}
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   173
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   174
gboolean
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   175
lm_socket_read (LmSocket *socket,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   176
                gchar    *buf,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   177
                gsize     buf_len,
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   178
                gsize     read_len)
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   179
{
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   180
        return FALSE;
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   181
}
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   182
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   183
void 
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   184
lm_socket_disconnect (LmSocket *socket)
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   185
{
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   186
}
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   187
63a049d146c3 Added basic API for the new LmSocket
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   188