Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
youngwolf
ascs
提交
191c9d56
A
ascs
项目概览
youngwolf
/
ascs
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
ascs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
191c9d56
编写于
11月 23, 2019
作者:
Y
youngwolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make the link status available via tcp::socket_base::get_link_status().
send_msg (series) support char[] as the input source.
上级
d1a0b47d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
11 addition
and
0 deletion
+11
-0
include/ascs/base.h
include/ascs/base.h
+8
-0
include/ascs/config.h
include/ascs/config.h
+2
-0
include/ascs/tcp/socket.h
include/ascs/tcp/socket.h
+1
-0
未找到文件。
include/ascs/base.h
浏览文件 @
191c9d56
...
...
@@ -587,6 +587,7 @@ template<typename _Predicate> void NAME(const _Predicate& __pred) const {for (au
//TCP msg sending interface
#define TCP_SEND_MSG_CALL_SWITCH(FUNNAME, TYPE) \
TYPE FUNNAME(const char* pstr, size_t len, bool can_overflow = false) {return FUNNAME(&pstr, &len, 1, can_overflow);} \
TYPE FUNNAME(char* pstr, size_t len, bool can_overflow = false) {return FUNNAME(&pstr, &len, 1, can_overflow);} \
template<typename Buffer> TYPE FUNNAME(const Buffer& buffer, bool can_overflow = false) {return FUNNAME(buffer.data(), buffer.size(), can_overflow);}
#define TCP_SEND_MSG(FUNNAME, NATIVE) \
...
...
@@ -662,6 +663,7 @@ TCP_SEND_MSG_CALL_SWITCH(FUNNAME, void)
//TCP sync msg sending interface
#define TCP_SYNC_SEND_MSG_CALL_SWITCH(FUNNAME, TYPE) \
TYPE FUNNAME(const char* pstr, size_t len, unsigned duration = 0, bool can_overflow = false) {return FUNNAME(&pstr, &len, 1, duration, can_overflow);} \
TYPE FUNNAME(char* pstr, size_t len, unsigned duration = 0, bool can_overflow = false) {return FUNNAME(&pstr, &len, 1, duration, can_overflow);} \
template<typename Buffer> TYPE FUNNAME(const Buffer& buffer, unsigned duration = 0, bool can_overflow = false) \
{return FUNNAME(buffer.data(), buffer.size(), duration, can_overflow);}
...
...
@@ -741,8 +743,11 @@ TCP_SYNC_SEND_MSG_CALL_SWITCH(FUNNAME, sync_call_result)
//UDP msg sending interface
#define UDP_SEND_MSG_CALL_SWITCH(FUNNAME, TYPE) \
TYPE FUNNAME(const char* pstr, size_t len, bool can_overflow = false) {return FUNNAME(peer_addr, pstr, len, can_overflow);} \
TYPE FUNNAME(char* pstr, size_t len, bool can_overflow = false) {return FUNNAME(peer_addr, pstr, len, can_overflow);} \
TYPE FUNNAME(const asio::ip::udp::endpoint& peer_addr, const char* pstr, size_t len, bool can_overflow = false) \
{return FUNNAME(peer_addr, &pstr, &len, 1, can_overflow);} \
TYPE FUNNAME(const asio::ip::udp::endpoint& peer_addr, char* pstr, size_t len, bool can_overflow = false) \
{return FUNNAME(peer_addr, &pstr, &len, 1, can_overflow);} \
template<typename Buffer> TYPE FUNNAME(const Buffer& buffer, bool can_overflow = false) {return FUNNAME(peer_addr, buffer, can_overflow);} \
template<typename Buffer> TYPE FUNNAME(const asio::ip::udp::endpoint& peer_addr, const Buffer& buffer, bool can_overflow = false) \
{return FUNNAME(peer_addr, buffer.data(), buffer.size(), can_overflow);}
...
...
@@ -773,8 +778,11 @@ UDP_SEND_MSG_CALL_SWITCH(FUNNAME, bool)
//UDP sync msg sending interface
#define UDP_SYNC_SEND_MSG_CALL_SWITCH(FUNNAME, TYPE) \
TYPE FUNNAME(const char* pstr, size_t len, unsigned duration = 0, bool can_overflow = false) {return FUNNAME(peer_addr, pstr, len, duration, can_overflow);} \
TYPE FUNNAME(char* pstr, size_t len, unsigned duration = 0, bool can_overflow = false) {return FUNNAME(peer_addr, pstr, len, duration, can_overflow);} \
TYPE FUNNAME(const asio::ip::udp::endpoint& peer_addr, const char* pstr, size_t len, unsigned duration = 0, bool can_overflow = false) \
{return FUNNAME(peer_addr, &pstr, &len, 1, duration, can_overflow);} \
TYPE FUNNAME(const asio::ip::udp::endpoint& peer_addr, char* pstr, size_t len, unsigned duration = 0, bool can_overflow = false) \
{return FUNNAME(peer_addr, &pstr, &len, 1, duration, can_overflow);} \
template<typename Buffer> TYPE FUNNAME(const Buffer& buffer, unsigned duration = 0, bool can_overflow = false) {return FUNNAME(peer_addr, buffer, duration, can_overflow);} \
template<typename Buffer> TYPE FUNNAME(const asio::ip::udp::endpoint& peer_addr, const Buffer& buffer, unsigned duration = 0, bool can_overflow = false) \
{return FUNNAME(peer_addr, buffer.data(), buffer.size(), duration, can_overflow);}
...
...
include/ascs/config.h
浏览文件 @
191c9d56
...
...
@@ -614,6 +614,8 @@
* virtual size_t raw_data_len(msg_ctype& msg) const
* Prefix the socket id (generated by ascs) for all logs.
* Prefix thread id for all logs.
* Make the link status available via tcp::socket_base::get_link_status().
* send_msg (series) support char[] as the input source.
*
* DELETION:
* Delete file mingw-build.bat, use mingw32-make instead.
...
...
include/ascs/tcp/socket.h
浏览文件 @
191c9d56
...
...
@@ -59,6 +59,7 @@ public:
virtual
void
reset
()
{
status
=
link_status
::
BROKEN
;
sending_msgs
.
clear
();
super
::
reset
();}
//SOCKET status
link_status
get_link_status
()
const
{
return
status
;}
bool
is_broken
()
const
{
return
link_status
::
BROKEN
==
status
;}
bool
is_connected
()
const
{
return
link_status
::
CONNECTED
==
status
;}
bool
is_shutting_down
()
const
{
return
link_status
::
FORCE_SHUTTING_DOWN
==
status
||
link_status
::
GRACEFUL_SHUTTING_DOWN
==
status
;}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录