Browse Source

set port = -1 if use Unix Domain Socket

ithewei 3 năm trước cách đây
mục cha
commit
350979122d
2 tập tin đã thay đổi với 2 bổ sung0 xóa
  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