| | |
| | | #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" { |
| | |
| | | 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 |
| | | |
| | | }; |
| | | |
| | |
| | | |
| | | |
| | | typedef struct shm_socket_t { |
| | | shm_socket_type_t socket_type; |
| | | // 本地port |
| | | int port; |
| | | shm_connection_status_t status; |
| | |
| | | |
| | | |
| | | |
| | | 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) ; |
| | |
| | | |
| | | 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); |
| | | |
| | | int shm_recvfrom(shm_socket_t *socket, void **buf, int *size, int *port); |
| | | |
| | | |
| | | #ifdef __cplusplus |