summaryrefslogtreecommitdiff
path: root/src/tools/echo/echo_server.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-06-14 14:56:55 +0200
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-06-14 14:56:55 +0200
commit337ab9fe73b86306b72b9eaae3b7be759f7bbd36 (patch)
treed7b237631ef17df911ec4aef766aba085a63bd30 /src/tools/echo/echo_server.c
parent6019a5b1ee574c8cea485ce5ba68ff77a24b4786 (diff)
parent6271d09bdd17114c3095b7e819a7bcded14f26a5 (diff)
downloadouroboros-337ab9fe73b86306b72b9eaae3b7be759f7bbd36.tar.gz
ouroboros-337ab9fe73b86306b72b9eaae3b7be759f7bbd36.zip
Merge remote-tracking branch 'upstream/be' into be-llc
Diffstat (limited to 'src/tools/echo/echo_server.c')
-rw-r--r--src/tools/echo/echo_server.c32
1 files changed, 2 insertions, 30 deletions
diff --git a/src/tools/echo/echo_server.c b/src/tools/echo/echo_server.c
index b72da319..c5e9f807 100644
--- a/src/tools/echo/echo_server.c
+++ b/src/tools/echo/echo_server.c
@@ -27,28 +27,15 @@
#include <ouroboros/dev.h>
-#define DIF_NAME "*"
-
void shutdown_server(int signo)
{
- char * dif = DIF_NAME;
-
- if (ap_unreg(&dif, 1)) {
- printf("Failed to unregister application.\n");
- ap_fini();
- exit(EXIT_FAILURE);
- }
-
ap_fini();
exit(EXIT_SUCCESS);
}
int server_main()
{
- int server_fd = 0;
int client_fd = 0;
- char * dif = DIF_NAME;
- char * client_name = NULL;
char buf[BUF_SIZE];
ssize_t count = 0;
@@ -60,27 +47,14 @@ int server_main()
return -1;
}
- if (ap_init(SERVER_AP_NAME)) {
- printf("Failed to init AP.\n");
- return -1;
- }
-
- server_fd = ap_reg(&dif, 1);
- if (server_fd < 0) {
- printf("Failed to register application.\n");
- ap_fini();
- return -1;
- }
-
while (true) {
- client_fd = flow_accept(server_fd,
- &client_name, NULL);
+ client_fd = flow_accept(NULL);
if (client_fd < 0) {
printf("Failed to accept flow.\n");
break;
}
- printf("New flow from %s.\n", client_name);
+ printf("New flow.\n");
if (flow_alloc_resp(client_fd, 0)) {
printf("Failed to give an allocate response.\n");
@@ -106,7 +80,5 @@ int server_main()
flow_dealloc(client_fd);
}
- ap_fini();
-
return 0;
}