diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-03-12 08:33:16 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-03-12 08:34:30 +0100 |
commit | 1249e72d92be71fd05846e9cdd3cc2523cd58816 (patch) | |
tree | 05a208b828c8b9f13dd55b19efbd09e050b7ad85 | |
parent | a4a103be6b3ab20dba82afef0c2b0f086eb3b436 (diff) | |
download | econ-1249e72d92be71fd05846e9cdd3cc2523cd58816.tar.gz econ-1249e72d92be71fd05846e9cdd3cc2523cd58816.tar.bz2 econ-1249e72d92be71fd05846e9cdd3cc2523cd58816.zip |
util: bind/connect: log which protocol is used
-rw-r--r-- | util.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) { |