From 973ea7eaee914ba2e296d97bdb0457b6732891e1 Mon Sep 17 00:00:00 2001 From: wangzhengquan <wangzhengquan85@126.com> Date: 星期五, 27 十一月 2020 18:55:58 +0800 Subject: [PATCH] update --- src/socket/net_mod_socket.c | 92 +++++++++++++++++++++++----------------------- 1 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/socket/net_mod_socket.c b/src/socket/net_mod_socket.c index bc40442..5ddf221 100644 --- a/src/socket/net_mod_socket.c +++ b/src/socket/net_mod_socket.c @@ -28,16 +28,16 @@ * 缁戝畾绔彛鍒皊ocket, 濡傛灉涓嶇粦瀹氬垯绯荤粺鑷姩鍒嗛厤涓�涓� * @return 0 鎴愬姛锛� 鍏朵粬鍊� 澶辫触鐨勯敊璇爜 */ -int NetModSocket::bind(int port) { - return shmModSocket.bind(port); +int NetModSocket::bind(int key) { + return shmModSocket.bind(key); } /** * 寮哄埗缁戝畾绔彛鍒皊ocket, 閫傜敤浜庣▼搴忛潪姝e父鍏抽棴鐨勬儏鍐典笅锛岄噸鍚▼搴忕粦瀹氬師鏉ヨ繕娌¢噴鏀剧殑key * @return 0 鎴愬姛锛� 鍏朵粬鍊� 澶辫触鐨勯敊璇爜 */ -int NetModSocket::force_bind( int port) { - return shmModSocket.force_bind(port); +int NetModSocket::force_bind( int key) { + return shmModSocket.force_bind(key); } int NetModSocket::sendandrecv(net_node_t *node_arr, int arrlen, void *send_buf, int send_size, @@ -373,57 +373,57 @@ /** * 鍙戦�佷俊鎭� - * @port 鍙戦�佺粰璋� + * @key 鍙戦�佺粰璋� * @return 0 鎴愬姛锛� 鍏朵粬鍊� 澶辫触鐨勯敊璇爜 */ -int NetModSocket::sendto(const void *buf, const int size, const int port){ - return shmModSocket.sendto(buf, size,port); +int NetModSocket::sendto(const void *buf, const int size, const int key){ + return shmModSocket.sendto(buf, size, key); } // 鍙戦�佷俊鎭秴鏃惰繑鍥炪�� @sec 绉� 锛� @nsec 绾崇 -int NetModSocket::sendto_timeout(const void *buf, const int size, const int port, int sec, int nsec){ +int NetModSocket::sendto_timeout(const void *buf, const int size, const int key, int sec, int nsec){ struct timespec timeout = {sec, nsec}; - return shmModSocket.sendto_timeout(buf, size, port, &timeout); + return shmModSocket.sendto_timeout(buf, size, key, &timeout); } // 鍙戦�佷俊鎭珛鍒昏繑鍥炪�� -int NetModSocket::sendto_nowait(const void *buf, const int size, const int port){ - return shmModSocket.sendto_nowait(buf, size,port); +int NetModSocket::sendto_nowait(const void *buf, const int size, const int key){ + return shmModSocket.sendto_nowait(buf, size, key); } /** * 鎺ユ敹淇℃伅 - * @port 浠庤皝鍝噷鏀跺埌鐨勪俊鎭� + * @key 浠庤皝鍝噷鏀跺埌鐨勪俊鎭� * @return 0 鎴愬姛锛� 鍏朵粬鍊� 澶辫触鐨勯敊璇爜 */ -int NetModSocket::recvfrom(void **buf, int *size, int *port) { - return shmModSocket.recvfrom(buf, size, port); +int NetModSocket::recvfrom(void **buf, int *size, int *key) { + return shmModSocket.recvfrom(buf, size, key); } // 鎺ュ彈淇℃伅瓒呮椂杩斿洖銆� @sec 绉� 锛� @nsec 绾崇 -int NetModSocket::recvfrom_timeout(void **buf, int *size, int *port, int sec, int nsec){ +int NetModSocket::recvfrom_timeout(void **buf, int *size, int *key, int sec, int nsec){ struct timespec timeout = {sec, nsec}; - return shmModSocket.recvfrom_timeout(buf, size, port, &timeout); + return shmModSocket.recvfrom_timeout(buf, size, key, &timeout); } -int NetModSocket::recvfrom_nowait(void **buf, int *size, int *port){ - return shmModSocket.recvfrom_nowait(buf, size, port); +int NetModSocket::recvfrom_nowait(void **buf, int *size, int *key){ + return shmModSocket.recvfrom_nowait(buf, size, key); } /** * 鍙戦�佽姹備俊鎭苟绛夊緟鎺ユ敹搴旂瓟 - * @port 鍙戦�佺粰璋� + * @key 鍙戦�佺粰璋� * @return 0 鎴愬姛锛� 鍏朵粬鍊� 澶辫触鐨勯敊璇爜 */ -int NetModSocket::sendandrecv( const void *send_buf, const int send_size, const int port, void **recv_buf, int *recv_size){ - return shmModSocket.sendandrecv(send_buf, send_size, port, recv_buf, recv_size); +int NetModSocket::sendandrecv( const void *send_buf, const int send_size, const int key, void **recv_buf, int *recv_size){ + return shmModSocket.sendandrecv(send_buf, send_size, key, recv_buf, recv_size); } // 瓒呮椂杩斿洖銆� @sec 绉� 锛� @nsec 绾崇 -int NetModSocket::sendandrecv_timeout( const void *send_buf, const int send_size, const int port, void **recv_buf, int *recv_size, int sec, int nsec){ +int NetModSocket::sendandrecv_timeout( const void *send_buf, const int send_size, const int key, void **recv_buf, int *recv_size, int sec, int nsec){ struct timespec timeout = {sec, nsec}; - return shmModSocket.sendandrecv_timeout(send_buf, send_size, port, recv_buf, recv_size, &timeout); + return shmModSocket.sendandrecv_timeout(send_buf, send_size, key, recv_buf, recv_size, &timeout); } -int NetModSocket::sendandrecv_nowait( const void *send_buf, const int send_size, const int port, void **recv_buf, int *recv_size) { - return shmModSocket.sendandrecv_nowait(send_buf, send_size, port, recv_buf, recv_size); +int NetModSocket::sendandrecv_nowait( const void *send_buf, const int send_size, const int key, void **recv_buf, int *recv_size) { + return shmModSocket.sendandrecv_nowait(send_buf, send_size, key, recv_buf, recv_size); } @@ -440,18 +440,18 @@ * 璁㈤槄鎸囧畾涓婚 * @topic 涓婚 * @size 涓婚闀垮害 - * @port 鎬荤嚎绔彛 + * @key 鎬荤嚎绔彛 */ -int NetModSocket::sub( void *topic, int size, int port){ - return shmModSocket.sub((char *)topic, size, port); +int NetModSocket::sub( void *topic, int size, int key){ + return shmModSocket.sub((char *)topic, size, key); } // 瓒呮椂杩斿洖銆� @sec 绉� 锛� @nsec 绾崇 -int NetModSocket::sub_timeout( void *topic, int size, int port, int sec, int nsec){ +int NetModSocket::sub_timeout( void *topic, int size, int key, int sec, int nsec){ struct timespec timeout = {sec, nsec}; - return shmModSocket.sub_timeout((char *)topic, size, port, &timeout); + return shmModSocket.sub_timeout((char *)topic, size, key, &timeout); } -int NetModSocket::sub_nowait( void *topic, int size, int port){ - return shmModSocket.sub_nowait((char *)topic, size, port); +int NetModSocket::sub_nowait( void *topic, int size, int key){ + return shmModSocket.sub_nowait((char *)topic, size, key); } @@ -460,18 +460,18 @@ * 鍙栨秷璁㈤槄鎸囧畾涓婚 * @topic 涓婚 * @size 涓婚闀垮害 - * @port 鎬荤嚎绔彛 + * @key 鎬荤嚎绔彛 */ -int NetModSocket::desub( void *topic, int size, int port){ - return shmModSocket.desub((char *)topic, size, port); +int NetModSocket::desub( void *topic, int size, int key){ + return shmModSocket.desub((char *)topic, size, key); } // 瓒呮椂杩斿洖銆� @sec 绉� 锛� @nsec 绾崇 -int NetModSocket::desub_timeout( void *topic, int size, int port, int sec, int nsec){ +int NetModSocket::desub_timeout( void *topic, int size, int key, int sec, int nsec){ struct timespec timeout = {sec, nsec}; - return shmModSocket.desub_timeout((char *)topic, size, port, &timeout); + return shmModSocket.desub_timeout((char *)topic, size, key, &timeout); } -int NetModSocket::desub_nowait( void *topic, int size, int port){ - return shmModSocket.desub_nowait((char *)topic, size, port); +int NetModSocket::desub_nowait( void *topic, int size, int key){ + return shmModSocket.desub_nowait((char *)topic, size, key); } @@ -480,18 +480,18 @@ * 鍙戝竷涓婚 * @topic 涓婚 * @content 涓婚鍐呭 - * @port 鎬荤嚎绔彛 + * @key 鎬荤嚎绔彛 */ -int NetModSocket::pub( char *topic, int topic_size, void *content, int content_size, int port){ - return shmModSocket.pub(topic, topic_size, content, content_size, port); +int NetModSocket::pub( char *topic, int topic_size, void *content, int content_size, int key){ + return shmModSocket.pub(topic, topic_size, content, content_size, key); } // 瓒呮椂杩斿洖銆� @sec 绉� 锛� @nsec 绾崇 -int NetModSocket::pub_timeout( char *topic, int topic_size, void *content, int content_size, int port, int sec, int nsec){ +int NetModSocket::pub_timeout( char *topic, int topic_size, void *content, int content_size, int key, int sec, int nsec){ struct timespec timeout = {sec, nsec}; - return shmModSocket.pub_timeout(topic, topic_size, content, content_size, port, &timeout); + return shmModSocket.pub_timeout(topic, topic_size, content, content_size, key, &timeout); } -int NetModSocket::pub_nowait( char *topic, int topic_size, void *content, int content_size, int port){ - return shmModSocket.pub_nowait(topic, topic_size, content, content_size, port); +int NetModSocket::pub_nowait( char *topic, int topic_size, void *content, int content_size, int key){ + return shmModSocket.pub_nowait(topic, topic_size, content, content_size, key); } -- Gitblit v1.8.0