Browse Source

set port = -1 if use Unix Domain Socket

ithewei 3 years ago
parent
commit
350979122d
2 changed files with 2 additions and 0 deletions
  1. 1 0
      examples/tcp_echo_server.c
  2. 1 0
      examples/udp_echo_server.c

+ 1 - 0
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
 

+ 1 - 0
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