aboutsummaryrefslogtreecommitdiff
path: root/bee.c
diff options
context:
space:
mode:
Diffstat (limited to 'bee.c')
-rw-r--r--bee.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/bee.c b/bee.c
index 41fc24d..0cd3b13 100644
--- a/bee.c
+++ b/bee.c
@@ -1,4 +1,5 @@
#include "irc.h"
+#include "unix.h"
#include <stdio.h>
@@ -7,8 +8,30 @@
int
main()
{
- if (irc_connect()) { fputs("falure in irc_connect\n",stderr); return 1; }
+ /* if (irc_connect()) { fputs("falure in irc_connect\n",stderr); return 1; }
if (irc_handshake()) { fputs("failure in irc_handshake\n",stderr); return 1; }
+ */
+
+ int unixfd;
+ if ((unixfd = unix_setup("bees2.sock")) == -1) {
+ fputs("failure in unix_setup\n",stderr); return -1;
+ }
+
+ char buf[128];
+ ssize_t amt;
+ for (;;) {
+ if ((amt = recv(unixfd,buf,sizeof buf - 1,0)) == -1) {
+ perror("recv");
+ return 1;
+ } else if (amt == 0) {
+ puts("unix eof");
+ return 0;
+ } else {
+ buf[amt] = 0;
+ printf("got: %s\n",buf);
+ }
+ }
+
int x;
do {