aboutsummaryrefslogtreecommitdiffstats
path: root/apps/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/client.c')
-rw-r--r--apps/client.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/apps/client.c b/apps/client.c
index e1b650e..54f4c33 100644
--- a/apps/client.c
+++ b/apps/client.c
@@ -10,8 +10,58 @@ static char rcsid[] = "$Id$";
/*
* $Log$
+ * Revision 1.2 2008/02/14 00:57:58 james
+ * *** empty log message ***
+ *
* Revision 1.1 2008/02/13 18:05:06 james
* *** empty log message ***
*
*/
+#include <sympathy.h>
+#include "client.h"
+
+static void client_msg(s)
+{
+ printf ("%p [%d] %s\n", s->msg, s->msg->hdr.size , s->msg->debug.msg );
+
+
+
+}
+void
+client (void)
+{
+ Socket *s;
+ fd_set rfds, wfds;
+
+ s = socket_connect ("socket");
+
+
+ if (!s)
+ {
+ printf ("no socket");
+ return;
+ }
+
+ for (;;)
+ {
+ struct timeval tv = { 0, 100000 };
+
+
+ FD_ZERO (&rfds);
+ FD_ZERO (&wfds);
+
+ socket_pre_select (s, &rfds, &wfds);
+
+ select (FD_SETSIZE, &rfds, &wfds, NULL, &tv);
+
+ socket_post_select (s, &rfds, &wfds);
+
+ while (s->msg)
+ {
+ client_msg(s);
+ socket_consume_msg (s);
+ }
+ }
+
+}