From 69b42a43ca4b2d93be203c34f6b45f5de1e32a15 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Thu, 11 Apr 2024 13:13:15 +0800
Subject: [PATCH] Fix logger.c bug

---
 project/socketd/booster/socket.h |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/project/socketd/booster/socket.h b/project/socketd/booster/socket.h
index f0c5fb4..dc41d69 100644
--- a/project/socketd/booster/socket.h
+++ b/project/socketd/booster/socket.h
@@ -21,6 +21,7 @@
     char        host[HOSTNAME_LEN]; /* CLIENT: Connect server hostname; SERVER: Unused */
     int         port;               /* CLIENT: Connect server port;     SERVER: listen port */
     int         fd;                 /* socket descriptor  */
+    int         connected;          /* socket connect status: 1->connected 0->disconnected  */
 } socket_ctx_t;
 
 /*  description: initial socket context
@@ -45,6 +46,13 @@
  * return value: <0: failure   0:ok
  */
 extern int socket_listen(socket_ctx_t *sock);
+
+/*  description: check socket connect status
+ *   input args:
+ *               $sock:  socket context pointer
+ * return value: 1: connected   0:disconnected
+ */
+extern int socket_connected(socket_ctx_t *sock);
 
 /*  description: socket client connect to server
  *   input args:
@@ -76,10 +84,6 @@
 /*+-------------------------------------------------------------------+
  *|                socket utils function                              |
  *+-------------------------------------------------------------------+*/
-
-
-/*  socket connected or not: <0: failure  0:ok */
-extern int sock_check_connect(int sockfd);
 
 /* description: set socket listen port as reusable, fix port already used bug  */
 extern int socket_set_reuseaddr(int sockfd);

--
Gitblit v1.9.1