Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
IoTSharp
提交
59d8c2d0
I
IoTSharp
项目概览
jobily
/
IoTSharp
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
IoTSharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
59d8c2d0
编写于
11月 01, 2020
作者:
麦壳饼
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修正rpc 以及 许可路径
上级
7b89dcb2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
38 addition
and
19 deletion
+38
-19
IoTSharp/Clients/RpcClient.cs
IoTSharp/Clients/RpcClient.cs
+31
-10
IoTSharp/IoTSharp.csproj
IoTSharp/IoTSharp.csproj
+0
-8
IoTSharp/IoTSharp.xml
IoTSharp/IoTSharp.xml
+6
-0
LICENSE.txt
LICENSE.txt
+1
-1
未找到文件。
IoTSharp/Clients/RpcClient.cs
浏览文件 @
59d8c2d0
...
...
@@ -22,6 +22,7 @@ namespace IoTSharp.Extensions
private
readonly
ConcurrentDictionary
<
string
,
TaskCompletionSource
<
byte
[
]>
>
_waitingCalls
=
new
ConcurrentDictionary
<
string
,
TaskCompletionSource
<
byte
[
]>
>();
private
readonly
IMqttClient
_mqttClient
;
private
IMqttClientOptions
_mqtt
;
private
bool
disposedValue
;
public
RpcClient
(
IMqttClient
mqttClient
)
{
...
...
@@ -35,8 +36,8 @@ namespace IoTSharp.Extensions
_mqtt
=
mqtt
;
}
public
Task
<
byte
[
]>
ExecuteAsync
(
TimeSpan
timeout
,
string
deviceid
,
string
methodName
,
string
payload
,
MqttQualityOfServiceLevel
qualityOfServiceLevel
)
{
return
ExecuteAsync
(
timeout
,
deviceid
,
methodName
,
Encoding
.
UTF8
.
GetBytes
(
payload
),
qualityOfServiceLevel
,
CancellationToken
.
None
);
...
...
@@ -133,15 +134,7 @@ namespace IoTSharp.Extensions
tcs
.
TrySetResult
(
eventArgs
.
ApplicationMessage
.
Payload
);
}
public
void
Dispose
()
{
foreach
(
var
tcs
in
_waitingCalls
)
{
tcs
.
Value
.
SetCanceled
();
}
_waitingCalls
.
Clear
();
}
public
async
Task
ConnectAsync
()
{
...
...
@@ -152,5 +145,33 @@ namespace IoTSharp.Extensions
{
await
_mqttClient
.
DisconnectAsync
();
}
protected
virtual
void
Dispose
(
bool
disposing
)
{
if
(!
disposedValue
)
{
if
(
disposing
)
{
foreach
(
var
tcs
in
_waitingCalls
)
{
tcs
.
Value
.
SetCanceled
();
}
_waitingCalls
.
Clear
();
}
// TODO: 释放未托管的资源(未托管的对象)并替代终结器
// TODO: 将大型字段设置为 null
disposedValue
=
true
;
}
}
public
void
Dispose
()
{
Dispose
(
disposing
:
true
);
GC
.
SuppressFinalize
(
this
);
}
}
}
IoTSharp/IoTSharp.csproj
浏览文件 @
59d8c2d0
...
...
@@ -128,13 +128,5 @@
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="..\LICENSE.txt">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="LICENSE.txt">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
</Project>
\ No newline at end of file
IoTSharp/IoTSharp.xml
浏览文件 @
59d8c2d0
...
...
@@ -527,6 +527,12 @@
用户名密码
</summary>
</member>
<member
name=
"M:IoTSharp.IoTSharpExtension.CheckOrUpdateDevStatus(IoTSharp.Data.Device)"
>
<summary>
//如果上次活动时间距离当前时间超过10秒 或者 设备离线状态, 则更新状态。
</summary>
<param
name=
"device"
></param>
</member>
<member
name=
"T:IoTSharp.Handlers.EventBusHandler"
>
<summary>
iotsharp.services.datastream
...
...
LICENSE.txt
浏览文件 @
59d8c2d0
MIT License
Copyright (c) 2018-2020 IoT
#
Copyright (c) 2018-2020 IoT
Sahrp Maikebing(Yanhong Ma)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录