Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
阿啄debugIT
libfastcommon
提交
082a322f
L
libfastcommon
项目概览
阿啄debugIT
/
libfastcommon
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libfastcommon
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
082a322f
编写于
9月 27, 2020
作者:
Y
YuQing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change port type to uint16_t
上级
55fc4013
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
17 deletion
+17
-17
src/connection_pool.h
src/connection_pool.h
+2
-2
src/sockopt.c
src/sockopt.c
+5
-5
src/sockopt.h
src/sockopt.h
+10
-10
未找到文件。
src/connection_pool.h
浏览文件 @
082a322f
...
...
@@ -36,7 +36,7 @@ extern "C" {
typedef
struct
{
int
sock
;
shor
t
port
;
uint16_
t
port
;
short
socket_domain
;
//socket domain, AF_INET, AF_INET6 or AF_UNSPEC for auto dedect
bool
validate_flag
;
//for connection pool
char
ip_addr
[
INET6_ADDRSTRLEN
];
...
...
@@ -306,7 +306,7 @@ static inline void conn_pool_set_server_info(ConnectionInfo *pServerInfo,
}
static
inline
int
conn_pool_compare_ip_and_port
(
const
char
*
ip1
,
const
short
port1
,
const
char
*
ip2
,
const
shor
t
port2
)
const
int
port1
,
const
char
*
ip2
,
const
in
t
port2
)
{
int
result
;
if
((
result
=
strcmp
(
ip1
,
ip2
))
!=
0
)
{
...
...
src/sockopt.c
浏览文件 @
082a322f
...
...
@@ -471,7 +471,7 @@ int tcpsenddata_nb(int sock, void* data, const int size, const int timeout)
return
0
;
}
int
setsockaddrbyip
(
const
char
*
ip
,
const
shor
t
port
,
sockaddr_convert_t
*
convert
)
int
setsockaddrbyip
(
const
char
*
ip
,
const
uint16_
t
port
,
sockaddr_convert_t
*
convert
)
{
int
af
;
void
*
dest
;
...
...
@@ -505,7 +505,7 @@ int setsockaddrbyip(const char *ip, const short port, sockaddr_convert_t *conver
return
0
;
}
int
connectserverbyip
(
int
sock
,
const
char
*
server_ip
,
const
shor
t
server_port
)
int
connectserverbyip
(
int
sock
,
const
char
*
server_ip
,
const
uint16_
t
server_port
)
{
int
result
;
sockaddr_convert_t
convert
;
...
...
@@ -524,7 +524,7 @@ int connectserverbyip(int sock, const char *server_ip, const short server_port)
}
int
connectserverbyip_nb_ex
(
int
sock
,
const
char
*
server_ip
,
\
const
shor
t
server_port
,
const
int
timeout
,
\
const
uint16_
t
server_port
,
const
int
timeout
,
\
const
bool
auto_detect
)
{
int
result
;
...
...
@@ -636,7 +636,7 @@ int connectserverbyip_nb_ex(int sock, const char *server_ip, \
}
int
asyncconnectserverbyip
(
int
sock
,
const
char
*
server_ip
,
const
shor
t
server_port
)
const
uint16_
t
server_port
)
{
int
result
;
sockaddr_convert_t
convert
;
...
...
@@ -701,7 +701,7 @@ int socketCreateEx2(int af, const char *server_ip,
}
int
socketClientEx2
(
int
af
,
const
char
*
server_ip
,
const
shor
t
server_port
,
const
int
timeout
,
const
uint16_
t
server_port
,
const
int
timeout
,
const
int
flags
,
const
char
*
bind_ipaddr
,
int
*
err_no
)
{
int
sock
;
...
...
src/sockopt.h
浏览文件 @
082a322f
...
...
@@ -171,7 +171,7 @@ int tcpsenddata_nb(int sock, void* data, const int size, const int timeout);
* server_port: port of the server
* return: error no, 0 success, != 0 fail
*/
int
connectserverbyip
(
int
sock
,
const
char
*
server_ip
,
const
shor
t
server_port
);
int
connectserverbyip
(
int
sock
,
const
char
*
server_ip
,
const
uint16_
t
server_port
);
/** connect to server by non-block mode
* parameters:
...
...
@@ -183,7 +183,7 @@ int connectserverbyip(int sock, const char *server_ip, const short server_port);
* return: error no, 0 success, != 0 fail
*/
int
connectserverbyip_nb_ex
(
int
sock
,
const
char
*
server_ip
,
\
const
shor
t
server_port
,
const
int
timeout
,
\
const
uint16_
t
server_port
,
const
int
timeout
,
\
const
bool
auto_detect
);
/** connect to server by non-block mode, the socket must be set to non-block
...
...
@@ -217,7 +217,7 @@ int connectserverbyip_nb_ex(int sock, const char *server_ip, \
* return: error no, 0 or EINPROGRESS for success, others for fail
*/
int
asyncconnectserverbyip
(
int
sock
,
const
char
*
server_ip
,
const
shor
t
server_port
);
const
uint16_
t
server_port
);
/** accept client connect request
* parameters:
...
...
@@ -414,7 +414,7 @@ static inline int socketCreateExAuto(const char *server_ip,
* return: >= 0 server socket, < 0 fail
*/
int
socketClientEx2
(
int
af
,
const
char
*
server_ip
,
const
shor
t
server_port
,
const
int
timeout
,
const
uint16_
t
server_port
,
const
int
timeout
,
const
int
flags
,
const
char
*
bind_ipaddr
,
int
*
err_no
);
/** connect to server
...
...
@@ -428,7 +428,7 @@ int socketClientEx2(int af, const char *server_ip,
* return: >= 0 server socket, < 0 fail
*/
static
inline
int
socketClientExAuto
(
const
char
*
server_ip
,
const
shor
t
server_port
,
const
int
timeout
,
const
uint16_
t
server_port
,
const
int
timeout
,
const
int
flags
,
const
char
*
bind_ipaddr
,
int
*
err_no
)
{
return
socketClientEx2
(
AF_UNSPEC
,
server_ip
,
server_port
,
...
...
@@ -446,7 +446,7 @@ static inline int socketClientExAuto(const char *server_ip,
* return: >= 0 server socket, < 0 fail
*/
static
inline
int
socketClientAuto
(
const
char
*
server_ip
,
const
shor
t
server_port
,
const
int
timeout
,
const
uint16_
t
server_port
,
const
int
timeout
,
const
int
flags
,
int
*
err_no
)
{
return
socketClientEx2
(
AF_UNSPEC
,
server_ip
,
server_port
,
...
...
@@ -464,7 +464,7 @@ static inline int socketClientAuto(const char *server_ip,
* return: >= 0 server socket, < 0 fail
*/
static
inline
int
socketClient2
(
int
af
,
const
char
*
server_ip
,
const
shor
t
server_port
,
const
int
timeout
,
const
uint16_
t
server_port
,
const
int
timeout
,
const
int
flags
,
int
*
err_no
)
{
return
socketClientEx2
(
af
,
server_ip
,
server_port
,
...
...
@@ -481,7 +481,7 @@ static inline int socketClient2(int af, const char *server_ip,
* return: >= 0 server socket, < 0 fail
*/
static
inline
int
socketClient
(
const
char
*
server_ip
,
const
shor
t
server_port
,
const
int
timeout
,
const
uint16_
t
server_port
,
const
int
timeout
,
const
int
flags
,
int
*
err_no
)
{
return
socketClient2
(
AF_INET
,
server_ip
,
server_port
,
...
...
@@ -498,7 +498,7 @@ static inline int socketClient(const char *server_ip,
* return: >= 0 server socket, < 0 fail
*/
static
inline
int
socketClientIPv6
(
const
char
*
server_ip
,
const
shor
t
server_port
,
const
int
timeout
,
const
uint16_
t
server_port
,
const
int
timeout
,
const
int
flags
,
int
*
err_no
)
{
return
socketClient2
(
AF_INET6
,
server_ip
,
server_port
,
...
...
@@ -611,7 +611,7 @@ int getifconfigs(FastIFConfig *if_configs, const int max_count, int *count);
* convert: the convert struct for IPv4 and IPv6 compatibility
* return: error no, 0 success, != 0 fail
*/
int
setsockaddrbyip
(
const
char
*
ip
,
const
shor
t
port
,
sockaddr_convert_t
*
convert
);
int
setsockaddrbyip
(
const
char
*
ip
,
const
uint16_
t
port
,
sockaddr_convert_t
*
convert
);
static
inline
bool
is_ipv6_addr
(
const
char
*
ip
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录