chiark / gitweb /
*** empty log message ***
[sympathy.git] / apps / client.c
index e1b650ee66ed689225ebe9f43f34c02721593462..54f4c337ba57e9183cb653837d6e11e13c8843a7 100644 (file)
@@ -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);
+        }
+    }
+
+}