From 03987ef3d1ed9c2d604561a69db169cd535014b6 Mon Sep 17 00:00:00 2001
From: wangzhengquan <wangzhengquan85@126.com>
Date: 星期六, 25 七月 2020 16:17:04 +0800
Subject: [PATCH] commit

---
 src/socket/include/shm_socket.h |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/socket/include/shm_socket.h b/src/socket/include/shm_socket.h
index 8b14f06..7025f9e 100644
--- a/src/socket/include/shm_socket.h
+++ b/src/socket/include/shm_socket.h
@@ -4,11 +4,6 @@
 #include "usg_common.h"
 #include "usg_typedef.h"
 #include "shm_queue.h"
-#include "shm_allocator.h"
-
-#include "mem_pool.h"
-#include "hashtable.h"
-#include "sem_util.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -20,6 +15,13 @@
 	SHM_SOCKET_OPEN_REPLY = 2,
 	SHM_SOCKET_CLOSE = 3,
 	SHM_COMMON_MSG = 4
+	
+};
+
+enum shm_socket_type_t
+{
+	SHM_SOCKET_STREAM = 1,
+	SHM_SOCKET_DGRAM = 2
 	
 };
 
@@ -39,6 +41,7 @@
 
 
 typedef struct shm_socket_t {
+	shm_socket_type_t socket_type;
 	// 鏈湴port
 	int port;
 	shm_connection_status_t status;
@@ -54,7 +57,7 @@
 
 
 
-shm_socket_t *shm_open_socket();
+shm_socket_t *shm_open_socket(shm_socket_type_t socket_type);
 
 
 int shm_close_socket(shm_socket_t * socket) ;
@@ -70,8 +73,13 @@
 
 int shm_send(shm_socket_t * socket, const void *buf, const int size) ;
 
+int shm_sendandrecv(shm_socket_t *socket, const void *send_buf, const int send_size, const int send_port, void **recv_buf, int *recv_size);
+
 int shm_recv(shm_socket_t * socket, void **buf, int *size) ;
 
+int shm_sendto(shm_socket_t *socket, const void *buf, const int size, const int port, const struct timespec * timeout = NULL);
+
+int shm_recvfrom(shm_socket_t *socket, void **buf, int *size, int *port);
 
 
 #ifdef __cplusplus

--
Gitblit v1.8.0