From 37989e0300c20cd65a4d4a3c49eeaea2122ddf9e Mon Sep 17 00:00:00 2001
From: wangzhengquan <wangzhengquan85@126.com>
Date: 星期一, 20 七月 2020 10:28:02 +0800
Subject: [PATCH] update
---
queue/include/shm_socket.h | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/queue/include/shm_socket.h b/queue/include/shm_socket.h
index f14dbc6..cb09e25 100644
--- a/queue/include/shm_socket.h
+++ b/queue/include/shm_socket.h
@@ -23,6 +23,12 @@
};
+enum shm_connection_status_t {
+ SHM_CONN_CLOSED=1,
+ SHM_CONN_LISTEN=2,
+ SHM_CONN_ESTABLISHED=3
+};
+
typedef struct shm_msg_t {
int port;
shm_msg_type_t type;
@@ -35,6 +41,7 @@
typedef struct shm_socket_t {
// 鏈湴port
int port;
+ shm_connection_status_t status;
SHMQueue<shm_msg_t> *queue;
SHMQueue<shm_msg_t> *remoteQueue;
LockFreeQueue<shm_msg_t, DM_Allocator> *messageQueue;
@@ -69,7 +76,7 @@
int shm_close_socket(shm_socket_t * socket) ;
-int shm_bind(shm_socket_t * socket, int port) ;
+int shm_socket_bind(shm_socket_t * socket, int port) ;
int shm_listen(shm_socket_t * socket) ;
@@ -77,7 +84,7 @@
int shm_connect(shm_socket_t * socket, int port);
-int shm_send(shm_socket_t * socket, void *buf, int size) ;
+int shm_send(shm_socket_t * socket, const void *buf, const int size) ;
int shm_recv(shm_socket_t * socket, void **buf, int *size) ;
--
Gitblit v1.8.0