summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Dritschler <timo.dritschler@kit.edu>2014-04-25 12:44:32 +0200
committerTimo Dritschler <timo.dritschler@kit.edu>2014-04-25 12:46:53 +0200
commit87598eb305b64b009f6ed6d690edae9947759152 (patch)
tree64fea0297a8784430a11c07acf22eca04be59c97
parentf205d2e6729e48b56ae659e426f71385870e7afb (diff)
downloadkiro-87598eb305b64b009f6ed6d690edae9947759152.tar.gz
kiro-87598eb305b64b009f6ed6d690edae9947759152.tar.bz2
kiro-87598eb305b64b009f6ed6d690edae9947759152.tar.xz
kiro-87598eb305b64b009f6ed6d690edae9947759152.zip
Small detail fix in KIRO Server
Added small test program for KIRO Server and Client Updated Makefile
-rw-r--r--Makefile20
-rw-r--r--kiro-server.c2
-rw-r--r--test-client.c12
-rw-r--r--test-server.c12
4 files changed, 39 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 104ee44..4e39036 100644
--- a/Makefile
+++ b/Makefile
@@ -3,11 +3,12 @@ CFLAGS=-std=c99 -Wall -g -gdwarf-2 $(shell pkg-config --cflags gobject-2.0)
LDFLAGS= -lrdmacm -libverbs -lpthread $(shell pkg-config --libs gobject-2.0)
+.PHONY : all
all: base
base: kiro-trb.o kiro-client.o kiro-server.o
-kiro-cbr.o: kiro-trb.c kiro-trb.h
+kiro-trb.o: kiro-trb.c kiro-trb.h
$(CC) $(CFLAGS) $(LDFLAGS) -c kiro-trb.c -o kiro-trb.o
kiro-client.o: kiro-client.c kiro-client.h
@@ -17,17 +18,24 @@ kiro-server.o: kiro-server.c kiro-server.h
$(CC) $(CFLAGS) $(LDFLAGS) -c kiro-server.c -o kiro-server.o
+.PHONY : test
+test: test-trb client server
-test-trb: test
-
-test: kiro-trb.o test.c
+test-trb: kiro-trb.o test.c
$(CC) $(CFLAGS) $(LDFLAGS) test.c kiro-trb.o -o test-trb
+client: kiro-client.o test-client.c
+ $(CC) $(CFLAGS) $(LDFLAGS) test-client.c kiro-client.o -o client
-clean:
- rm -f *.o test-trb
+server: kiro-server.o test-server.c
+ $(CC) $(CFLAGS) $(LDFLAGS) test-server.c kiro-server.o -o server
+.PHONY : clean
+clean:
+ rm -f *.o test-trb client server
+
+.PHONY : rebuild
rebuild: clean all
diff --git a/kiro-server.c b/kiro-server.c
index 2636817..145922a 100644
--- a/kiro-server.c
+++ b/kiro-server.c
@@ -115,7 +115,7 @@ int kiro_server_start (KiroServer *self, char *address, char *port)
return -1;
}
- if(rdma_listen(priv->base, NULL))
+ if(rdma_listen(priv->base, 0))
{
printf("Failed to put server into listening state.\n");
rdma_destroy_ep(priv->base);
diff --git a/test-client.c b/test-client.c
new file mode 100644
index 0000000..1df974c
--- /dev/null
+++ b/test-client.c
@@ -0,0 +1,12 @@
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "kiro-client.h"
+
+
+int main(void)
+{
+ KiroClient *client = g_object_new(KIRO_TYPE_CLIENT, NULL);
+ kiro_client_connect(client, "127.0.0.1", "60010", 5000);
+ return 0;
+} \ No newline at end of file
diff --git a/test-server.c b/test-server.c
new file mode 100644
index 0000000..cac62e6
--- /dev/null
+++ b/test-server.c
@@ -0,0 +1,12 @@
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "kiro-server.h"
+
+
+int main(void)
+{
+ KiroServer *server = g_object_new(KIRO_TYPE_SERVER, NULL);
+ kiro_server_start(server, "127.0.0.1", "60010");
+ return 0;
+} \ No newline at end of file