当前位置:网站首页>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
边栏推荐
- 【深入理解TcaplusDB技术】TcaplusDB事务管理——错误排查
- 【深入理解TcaplusDB技術】TcaplusDB運維——日常巡檢
- Nlp-d57-nlp competition D26 & skimming questions D13 & reading papers & finding bugs for more than an hour
- R语言数据预处理、把类型变量转化为因子变量,把数据集转化为h2o格式、数据集划分(训练集、测试集、验证集)
- 卡尔加里大学|基于强化学习的推荐系统综述
- [deeply understand tcapulusdb technology] tcapulusdb table management - rebuild table
- 基于Sentinel的高可用限流系统的Grafana报表展示
- How to use yincan IS903 to master DIY's own USB flash disk? (good items for practicing BGA welding)
- B tree code (C language)
- 【深入理解TcaplusDB技术】TcaplusDB机器如何下架
猜你喜欢
![[deeply understand tcapulusdb technology] tcapulusdb table management - clean up table](/img/2b/3ab5e247ac103728b4d3579c3c5468.png)
[deeply understand tcapulusdb technology] tcapulusdb table management - clean up table

Definitions and terms of drawings

图的定义及术语
![[in depth understanding of tcapulusdb technology] introduction tcapulusdb problem summary](/img/2b/3ab5e247ac103728b4d3579c3c5468.png)
[in depth understanding of tcapulusdb technology] introduction tcapulusdb problem summary

Damp 3D printer consumables

程序员应该怎么查日期

#夏日挑战赛# 【FFH】从零开始的鸿蒙机器学习之旅-NLP情感分析

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

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

Matplotlib set axis scale interval
随机推荐
插值查找和折半(二分)查找
[petty bourgeoisie database] break down the concept: data, database, database system, database management system, database technology
[in depth understanding of tcapulusdb technology] getting started with MySQL driver
【深入理解TcaplusDB技术】入门TcaplusDB 问题汇总
[compréhension approfondie de la base de connaissances tcaplusdb] déploiement de la version locale de tcaplusdb FAQ
R语言基于h2o包构建二分类模型:使用h2o.glm构建正则化的逻辑回归模型、使用h2o.auc计算模型的AUC值
#夏日挑战赛# 【FFH】从零开始的鸿蒙机器学习之旅-NLP情感分析
Openpnp debugging ------ 0816 Feida Tui 0402 taping
[in depth understanding of tcaplus DB technology] getting started tcaplus SQL driver
【深入理解TcaplusDB技术】TcaplusDB常规单据
Async-profiler介绍
How to judge whether text is an array in the slot
堆排序(原理加代码)
[in depth understanding of tcaplus DB technology] Introduction to tcaplus JDBC development
[deeply understand tcapulusdb technology] cluster management operation
数字货币钱包开发不知道怎么选?
C语言实现平衡二叉树
lua--迭代器、模块、元表
第一篇 热身--隐式类型转换还是其他?
DynamicDatabaseSource,在应用端支持数据库的主从