当前位置:网站首页>Connect function usage of socket
Connect function usage of socket
2022-06-22 20:05:00 【Tao song remains the same】
Look at the source code , See such a piece of code :
static int connSocketConnect(connection *conn, const char *addr, int port, const char *src_addr,
ConnectionCallbackFunc connect_handler) {
int fd = anetTcpNonBlockBestEffortBindConnect(NULL,addr,port,src_addr);
if (fd == -1) {
conn->state = CONN_STATE_ERROR;
conn->last_errno = errno;
return C_ERR;
}
conn->fd = fd;
conn->state = CONN_STATE_CONNECTING;
conn->conn_handler = connect_handler;
aeCreateFileEvent(server.el, conn->fd, AE_WRITABLE,
conn->type->ae_handler, conn);
return C_OK;
}
Timeout in implementation connect When , So often , need set nonblock socket
边栏推荐
- R语言数据预处理、把类型变量转化为因子变量,把数据集转化为h2o格式、数据集划分(训练集、测试集、验证集)
- 商业智能BI数据仓库中的指标、维度和模型到底是什么?
- 【深入理解TcaplusDB技术】TcaplusDB 表管理——删除表
- [in depth understanding of tcapulusdb technology] tcapulusdb adds a new business cluster cluster
- Georgia Institute of technology - coordinated coverage and tracking planning of multi UAV wildfire with service quality assurance
- Goldfish rhca memoirs: do447 managing user and team access -- creating and managing ansible tower users
- Bubble sort, select sort, direct insert sort
- socket的connect函数用法
- 北京大学|通过对比学习实现离线元强化学习的鲁棒任务表示
- [deeply understand tcapulusdb technology] tcapulusdb transaction management - error troubleshooting
猜你喜欢

树、森林及二叉树的相互转换

商业智能BI数据仓库中的指标、维度和模型到底是什么?

Definitions and terms of drawings

1.2----- mechanical design tools (CAD software) and hardware design tools (EDA software) and comparison

树和森林的遍历

Comparison of NAND flash particles SLC, MLC, TLC and QLC

元宇宙怎么就这么火,市场喊起来的10万亿是吹嘘还是真相?

matplotlib设置坐标轴刻度间隔

基于Sentinel的高可用限流系统的Grafana报表展示

Storage structure of graph (adjacency matrix)
随机推荐
What can the accelerated implementation of digital economy bring to SMEs?
[in depth understanding of tcapulusdb technology] tcapulusdb operation and maintenance doc
[compréhension approfondie de la technologie tcaplusdb] exploitation et entretien de tcaplusdb - inspection quotidienne des patrouilles
Georgia Institute of technology - coordinated coverage and tracking planning of multi UAV wildfire with service quality assurance
[in depth understanding of tcapulusdb technology] getting started with MySQL driver
R语言数据预处理、把类型变量转化为因子变量,把数据集转化为h2o格式、数据集划分(训练集、测试集、验证集)
漫话Redis源码之一百一二十
【深入理解TcaplusDB技术】TcaplusDB机器如何初始化和上架
[deeply understand tcapulusdb technology] tcapulusdb transaction management - error troubleshooting
MySQL数据库DQL练习题
【深入理解TcaplusDB技术】TcaplusDB机型
如何低成本快速搭建企业知识库?
使用 Order by 与 rownum SQL 优化案例一则
插值查找和折半(二分)查找
元宇宙怎么就这么火,市场喊起来的10万亿是吹嘘还是真相?
Openpnp debugging ------ 0816 Feida Tui 0402 taping
Redis中的Multi事务
数字货币钱包开发不知道怎么选?
How to judge whether text is an array in the slot
如何在 FlowUs和Notion 等笔记软件中进行任务管理?