summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-03-12 08:33:16 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-03-12 08:34:30 +0100
commit1249e72d92be71fd05846e9cdd3cc2523cd58816 (patch)
tree05a208b828c8b9f13dd55b19efbd09e050b7ad85 /util.c
parenta4a103be6b3ab20dba82afef0c2b0f086eb3b436 (diff)
downloadecon-1249e72d92be71fd05846e9cdd3cc2523cd58816.tar.gz
econ-1249e72d92be71fd05846e9cdd3cc2523cd58816.tar.bz2
econ-1249e72d92be71fd05846e9cdd3cc2523cd58816.zip
util: bind/connect: log which protocol is used
Diffstat (limited to 'util.c')
-rw-r--r--util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/util.c b/util.c
index cedcc72..fc0630e 100644
--- a/util.c
+++ b/util.c
@@ -139,7 +139,8 @@ bind_socket(int socktype, const char *host, const char *port)
hints.ai_family = AF_INET;
hints.ai_socktype = socktype;
- printf("bind to host: %s, port: %s\n", host, port);
+ printf("bind to host: %s, %s.port: %s\n",
+ host, socktype == SOCK_STREAM ? "tcp" : "udp", port);
s = getaddrinfo(host, port, &hints, &result);
if (s != 0) {
@@ -186,7 +187,8 @@ connect_to_host(int socktype, const char *host, const char *port)
hints.ai_family = AF_INET;
hints.ai_socktype = socktype;
- printf("connect to host: %s, port: %s\n", host, port);
+ printf("connect to host: %s, %s.port: %s\n",
+ host, socktype == SOCK_STREAM ? "tcp" : "udp", port);
s = getaddrinfo(host, port, &hints, &result);
if (s != 0) {