修改网络的初始化,异步支持问题
This commit is contained in:
@@ -27,6 +27,8 @@ typedef enum {
|
||||
NET_MSG_RECV,
|
||||
NET_MSG_CLOSE,
|
||||
NET_MSG_CONNECT,
|
||||
NET_MSG_LISTEN,
|
||||
NET_MSG_ACCEPT,
|
||||
} net_msg_type_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -318,6 +320,15 @@ int net_recv_sock(net_sock_t *p_sock, void *buf, int len, int flags);
|
||||
*/
|
||||
int net_close_sock(net_sock_t *p_sock);
|
||||
|
||||
/*
|
||||
* 函数功能:启动 TCP Server 监听(内部版本,直接操作,不经过消息队列)
|
||||
* 入口参数:sockfd - Socket 描述符
|
||||
* backlog - 数据 Socket 数量(0=单连接模式)
|
||||
* 返回值:0 成功,-1 失败
|
||||
* 限定条件:必须在 netTask 上下文中调用
|
||||
*/
|
||||
int net_listen_locked(int sockfd, int backlog);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user