diff --git a/examples/tcp_echo_server.c b/examples/tcp_echo_server.c
index 20e7eda25..f48788fb0 100644
--- a/examples/tcp_echo_server.c
+++ b/examples/tcp_echo_server.c
@@ -102,6 +102,7 @@ int main(int argc, char** argv) {
#if ENABLE_UDS
if (port == 0) {
host = argv[1];
+ port = -1;
}
#endif
diff --git a/examples/udp_echo_server.c b/examples/udp_echo_server.c
index c04a9fa44..5ca0b1350 100644
--- a/examples/udp_echo_server.c
+++ b/examples/udp_echo_server.c
@@ -53,6 +53,7 @@ int main(int argc, char** argv) {
#if ENABLE_UDS
if (port == 0) {
host = argv[1];
+ port = -1;
}
#endif