ithewei il y a 5 ans
Parent
commit
c8f3765b28
2 fichiers modifiés avec 4 ajouts et 3 suppressions
  1. 1 1
      CMakeLists.txt
  2. 3 2
      examples/nc.c

+ 1 - 1
CMakeLists.txt

@@ -6,7 +6,7 @@ option(BUILD_SHARED "build shared library" ON)
 option(BUILD_STATIC "build static library" ON)
 
 option(BUILD_EXAMPLES "build examples" ON)
-option(BUILD_UNITTEST "build unittest" ON)
+option(BUILD_UNITTEST "build unittest" OFF)
 
 # see config.mk
 option(WITH_PROTOCOL "compile protocol" OFF)

+ 3 - 2
examples/nc.c

@@ -109,6 +109,8 @@ void on_connect(hio_t* io) {
     }
 
     hio_read_start(io);
+    // uncomment to test heartbeat
+    // hio_set_heartbeat(sockio, 3000, send_heartbeat);
 }
 
 int main(int argc, char** argv) {
@@ -165,11 +167,10 @@ Examples: nc 127.0.0.1 80\n\
     if (sockio == NULL) {
         return -20;
     }
-    //printf("sockfd=%d\n", hio_fd(sockio));
+    // printf("sockfd=%d\n", hio_fd(sockio));
     hio_setcb_close(sockio, on_close);
     hio_setcb_read(sockio, on_recv);
     hio_set_readbuf(sockio, recvbuf, RECV_BUFSIZE);
-    // hio_set_heartbeat(sockio, 1000, send_heartbeat);
 
     hloop_run(loop);
     hloop_free(&loop);