1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-16 00:00:02 +01:00

moved debug messages to node_connect()

git-svn-id: https://zerberus.eonerc.rwth-aachen.de:8443/svn/s2ss/trunk@235 8ec27952-4edc-4aab-86aa-e87bb2611832
This commit is contained in:
Steffen Vogel 2014-09-10 12:22:15 +00:00
parent 09170fe189
commit 074854b152
5 changed files with 11 additions and 20 deletions

View file

@ -7,6 +7,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include "config.h"
#include "cfg.h"
@ -39,6 +40,13 @@ int node_connect(struct node *n)
if (bind(n->sd, (struct sockaddr *) &n->local, sizeof(struct sockaddr_in)))
perror("Failed to bind to socket");
debug(1, " We listen for node '%s' at %s:%u",
n->name, inet_ntoa(n->local.sin_addr),
ntohs(n->local.sin_port));
debug(1, " We sent to node '%s' at %s:%u",
n->name, inet_ntoa(n->remote.sin_addr),
ntohs(n->remote.sin_port));
return 0;
}

View file

@ -56,11 +56,11 @@ int main(int argc, char *argv[])
if (resolve_addr(argv[1], &n.local, 0))
error("Failed to resolve local address: %s", argv[1]);
node_connect(&n);
/* Print header */
fprintf(stderr, "# %-6s %-8s %-12s\n", "dev_id", "seq_no", "data");
node_connect(&n);
while (1) {
msg_recv(&m, &n);

View file

@ -68,11 +68,7 @@ int main(int argc, char *argv[])
n.local.sin_port = 0; /* random port */
}
debug(1, "We listen at %s:%u", inet_ntoa(n.local.sin_addr), ntohs(n.local.sin_port));
debug(1, "We sent to %s:%u", inet_ntoa(n.remote.sin_addr), ntohs(n.remote.sin_port));
if (node_connect(&n))
error("Failed to connect node");
node_connect(&n);
while (!feof(stdin)) {
msg_fscan(stdin, &m);

View file

@ -6,14 +6,10 @@
#include <stdlib.h>
#include <stdio.h>
#include <error.h>
#include <sched.h>
#include <signal.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "config.h"
@ -81,12 +77,6 @@ static void start()
node_connect(n);
debug(1, " We listen for node '%s' at %s:%u",
n->name, inet_ntoa(n->local.sin_addr),
ntohs(n->local.sin_port));
debug(1, " We sent to node '%s' at %s:%u",
n->name, inet_ntoa(n->remote.sin_addr),
ntohs(n->remote.sin_port));
}
/* Start on thread per path for asynchronous processing */

View file

@ -66,9 +66,6 @@ int main(int argc, char *argv[])
node_connect(&n);
debug(1, "We listen at %s:%u", inet_ntoa(n.local.sin_addr), ntohs(n.local.sin_port));
debug(1, "We sent to %s:%u", inet_ntoa(n.remote.sin_addr), ntohs(n.remote.sin_port));
if (!strcmp(argv[1], "rtt")) {
struct msg m = MSG_INIT(sizeof(struct timespec) / sizeof(float));
struct timespec *ts1 = (struct timespec *) &m.data;