Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
若汝棋茗
RRQMSocket
提交
de941fcf
RRQMSocket
项目概览
若汝棋茗
/
RRQMSocket
10 个月 前同步成功
通知
20
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
RRQMSocket
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
de941fcf
编写于
6月 06, 2022
作者:
若
若汝棋茗
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
udp demo
上级
36594536
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
91 addition
and
27 deletion
+91
-27
RRQMSocket.sln
RRQMSocket.sln
+8
-8
examples/UdpDemoApp/Form1.Designer.cs
examples/UdpDemoApp/Form1.Designer.cs
+54
-18
examples/UdpDemoApp/Form1.cs
examples/UdpDemoApp/Form1.cs
+29
-1
examples/UdpDemoApp/Form1.resx
examples/UdpDemoApp/Form1.resx
+0
-0
examples/UdpDemoApp/Program.cs
examples/UdpDemoApp/Program.cs
+0
-0
examples/UdpDemoApp/UdpDemoApp.csproj
examples/UdpDemoApp/UdpDemoApp.csproj
+0
-0
未找到文件。
RRQMSocket.sln
浏览文件 @
de941fcf
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 1
7
VisualStudioVersion = 1
7.2.32526.322
# Visual Studio Version 1
6
VisualStudioVersion = 1
6.0.32428.217
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{06A5E4BC-4AE9-4F5F-BF8E-C6651413442B}"
EndProject
...
...
@@ -24,7 +24,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{5F888345-EC9
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "simple udp demo", "simple udp demo", "{F4D798A3-8D65-4750-9552-B02BCE081508}"
EndProject
Project("{
FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UdpDemoApp", "UdpDemoApp\UdpDemoApp.csproj", "{ED98D0B8-9CED-4304-93EE-7844AA296E78
}"
Project("{
9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UdpDemoApp", "examples\UdpDemoApp\UdpDemoApp.csproj", "{1C5F10E8-9F7E-495F-BFB3-DE9ED12480CA
}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
...
...
@@ -48,10 +48,10 @@ Global
{0B7591F5-37C8-4570-ACEF-782CE3F12957}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0B7591F5-37C8-4570-ACEF-782CE3F12957}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0B7591F5-37C8-4570-ACEF-782CE3F12957}.Release|Any CPU.Build.0 = Release|Any CPU
{
ED98D0B8-9CED-4304-93EE-7844AA296E78
}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{
ED98D0B8-9CED-4304-93EE-7844AA296E78
}.Debug|Any CPU.Build.0 = Debug|Any CPU
{
ED98D0B8-9CED-4304-93EE-7844AA296E78
}.Release|Any CPU.ActiveCfg = Release|Any CPU
{
ED98D0B8-9CED-4304-93EE-7844AA296E78
}.Release|Any CPU.Build.0 = Release|Any CPU
{
1C5F10E8-9F7E-495F-BFB3-DE9ED12480CA
}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{
1C5F10E8-9F7E-495F-BFB3-DE9ED12480CA
}.Debug|Any CPU.Build.0 = Debug|Any CPU
{
1C5F10E8-9F7E-495F-BFB3-DE9ED12480CA
}.Release|Any CPU.ActiveCfg = Release|Any CPU
{
1C5F10E8-9F7E-495F-BFB3-DE9ED12480CA
}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
...
...
@@ -63,7 +63,7 @@ Global
{0B7591F5-37C8-4570-ACEF-782CE3F12957} = {FB46E926-0EEC-488C-B950-A16D2E7F694B}
{FB46E926-0EEC-488C-B950-A16D2E7F694B} = {517CF381-4C15-4519-9BC4-92DC4C412C8D}
{F4D798A3-8D65-4750-9552-B02BCE081508} = {517CF381-4C15-4519-9BC4-92DC4C412C8D}
{
ED98D0B8-9CED-4304-93EE-7844AA296E78
} = {F4D798A3-8D65-4750-9552-B02BCE081508}
{
1C5F10E8-9F7E-495F-BFB3-DE9ED12480CA
} = {F4D798A3-8D65-4750-9552-B02BCE081508}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DB787235-A13A-4A3D-B5A8-5DFEB6511EEE}
...
...
UdpDemoApp/Form1.Designer.cs
→
examples/
UdpDemoApp/Form1.Designer.cs
浏览文件 @
de941fcf
...
...
@@ -35,47 +35,54 @@
this
.
button2
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
textBox4
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
checkBox1
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
button3
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
SuspendLayout
();
//
// button1
//
this
.
button1
.
Location
=
new
System
.
Drawing
.
Point
(
325
,
67
);
this
.
button1
.
Location
=
new
System
.
Drawing
.
Point
(
258
,
38
);
this
.
button1
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
button1
.
Name
=
"button1"
;
this
.
button1
.
Size
=
new
System
.
Drawing
.
Size
(
150
,
46
);
this
.
button1
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
25
);
this
.
button1
.
TabIndex
=
0
;
this
.
button1
.
Text
=
"
启动
"
;
this
.
button1
.
Text
=
"
监听
"
;
this
.
button1
.
UseVisualStyleBackColor
=
true
;
this
.
button1
.
Click
+=
new
System
.
EventHandler
(
this
.
button1_Click
);
//
// textBox1
//
this
.
textBox1
.
Location
=
new
System
.
Drawing
.
Point
(
15
,
355
);
this
.
textBox1
.
Location
=
new
System
.
Drawing
.
Point
(
8
,
195
);
this
.
textBox1
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
textBox1
.
Multiline
=
true
;
this
.
textBox1
.
Name
=
"textBox1"
;
this
.
textBox1
.
Size
=
new
System
.
Drawing
.
Size
(
1131
,
274
);
this
.
textBox1
.
Size
=
new
System
.
Drawing
.
Size
(
568
,
152
);
this
.
textBox1
.
TabIndex
=
1
;
//
// textBox2
//
this
.
textBox2
.
Location
=
new
System
.
Drawing
.
Point
(
23
,
72
);
this
.
textBox2
.
Location
=
new
System
.
Drawing
.
Point
(
12
,
39
);
this
.
textBox2
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
textBox2
.
Name
=
"textBox2"
;
this
.
textBox2
.
Size
=
new
System
.
Drawing
.
Size
(
296
,
38
);
this
.
textBox2
.
Size
=
new
System
.
Drawing
.
Size
(
150
,
23
);
this
.
textBox2
.
TabIndex
=
2
;
this
.
textBox2
.
Text
=
"127.0.0.1:7789"
;
//
// textBox3
//
this
.
textBox3
.
Location
=
new
System
.
Drawing
.
Point
(
23
,
152
);
this
.
textBox3
.
Location
=
new
System
.
Drawing
.
Point
(
12
,
83
);
this
.
textBox3
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
textBox3
.
Name
=
"textBox3"
;
this
.
textBox3
.
Size
=
new
System
.
Drawing
.
Size
(
296
,
38
);
this
.
textBox3
.
Size
=
new
System
.
Drawing
.
Size
(
150
,
23
);
this
.
textBox3
.
TabIndex
=
3
;
this
.
textBox3
.
Text
=
"127.0.0.1:7789"
;
//
// button2
//
this
.
button2
.
Location
=
new
System
.
Drawing
.
Point
(
325
,
152
);
this
.
button2
.
Location
=
new
System
.
Drawing
.
Point
(
166
,
82
);
this
.
button2
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
button2
.
Name
=
"button2"
;
this
.
button2
.
Size
=
new
System
.
Drawing
.
Size
(
150
,
46
);
this
.
button2
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
25
);
this
.
button2
.
TabIndex
=
4
;
this
.
button2
.
Text
=
"发送"
;
this
.
button2
.
UseVisualStyleBackColor
=
true
;
...
...
@@ -84,25 +91,51 @@
// label1
//
this
.
label1
.
AutoSize
=
true
;
this
.
label1
.
Location
=
new
System
.
Drawing
.
Point
(
635
,
107
);
this
.
label1
.
Location
=
new
System
.
Drawing
.
Point
(
370
,
58
);
this
.
label1
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
,
0
,
2
,
0
);
this
.
label1
.
MaximumSize
=
new
System
.
Drawing
.
Size
(
200
,
0
);
this
.
label1
.
Name
=
"label1"
;
this
.
label1
.
Size
=
new
System
.
Drawing
.
Size
(
2
54
,
3
1
);
this
.
label1
.
Size
=
new
System
.
Drawing
.
Size
(
2
00
,
5
1
);
this
.
label1
.
TabIndex
=
5
;
this
.
label1
.
Text
=
"可以启动两个程序测试"
;
this
.
label1
.
Text
=
"可以启动两个程序测试
,当选择大数据包时,发送端和接收端必须均为RRQM,或者自己实现对应算法。
"
;
//
// textBox4
//
this
.
textBox4
.
Location
=
new
System
.
Drawing
.
Point
(
25
,
210
);
this
.
textBox4
.
Location
=
new
System
.
Drawing
.
Point
(
12
,
115
);
this
.
textBox4
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
textBox4
.
Multiline
=
true
;
this
.
textBox4
.
Name
=
"textBox4"
;
this
.
textBox4
.
Size
=
new
System
.
Drawing
.
Size
(
294
,
139
);
this
.
textBox4
.
Size
=
new
System
.
Drawing
.
Size
(
149
,
78
);
this
.
textBox4
.
TabIndex
=
6
;
//
// checkBox1
//
this
.
checkBox1
.
AutoSize
=
true
;
this
.
checkBox1
.
Location
=
new
System
.
Drawing
.
Point
(
178
,
40
);
this
.
checkBox1
.
Name
=
"checkBox1"
;
this
.
checkBox1
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
21
);
this
.
checkBox1
.
TabIndex
=
7
;
this
.
checkBox1
.
Text
=
"大数据包"
;
this
.
checkBox1
.
UseVisualStyleBackColor
=
true
;
//
// button3
//
this
.
button3
.
Location
=
new
System
.
Drawing
.
Point
(
258
,
82
);
this
.
button3
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
button3
.
Name
=
"button3"
;
this
.
button3
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
25
);
this
.
button3
.
TabIndex
=
8
;
this
.
button3
.
Text
=
"发送1Mb数据"
;
this
.
button3
.
UseVisualStyleBackColor
=
true
;
this
.
button3
.
Click
+=
new
System
.
EventHandler
(
this
.
button3_Click
);
//
// Form1
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
14F
,
31
F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
7F
,
17
F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
1158
,
641
);
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
579
,
352
);
this
.
Controls
.
Add
(
this
.
button3
);
this
.
Controls
.
Add
(
this
.
checkBox1
);
this
.
Controls
.
Add
(
this
.
textBox4
);
this
.
Controls
.
Add
(
this
.
label1
);
this
.
Controls
.
Add
(
this
.
button2
);
...
...
@@ -110,6 +143,7 @@
this
.
Controls
.
Add
(
this
.
textBox2
);
this
.
Controls
.
Add
(
this
.
textBox1
);
this
.
Controls
.
Add
(
this
.
button1
);
this
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
2
);
this
.
Name
=
"Form1"
;
this
.
Text
=
"Form1"
;
this
.
ResumeLayout
(
false
);
...
...
@@ -126,5 +160,7 @@
private
System
.
Windows
.
Forms
.
Button
button2
;
private
System
.
Windows
.
Forms
.
Label
label1
;
private
System
.
Windows
.
Forms
.
TextBox
textBox4
;
private
System
.
Windows
.
Forms
.
CheckBox
checkBox1
;
private
System
.
Windows
.
Forms
.
Button
button3
;
}
}
UdpDemoApp/Form1.cs
→
examples/
UdpDemoApp/Form1.cs
浏览文件 @
de941fcf
...
...
@@ -25,8 +25,24 @@ namespace UdpDemoApp
{
m_udpSession
.
Received
+=
(
remote
,
byteBlock
,
requestInfo
)
=>
{
m_udpSession
.
Logger
.
Message
(
$"收到:
{
Encoding
.
UTF8
.
GetString
(
byteBlock
.
Buffer
,
0
,
byteBlock
.
Len
)}
"
);
if
(
byteBlock
.
Len
>
1024
)
{
m_udpSession
.
Logger
.
Message
(
$"收到:
{
byteBlock
.
Len
}
长度的数据。"
);
}
else
{
m_udpSession
.
Logger
.
Message
(
$"收到:
{
Encoding
.
UTF8
.
GetString
(
byteBlock
.
Buffer
,
0
,
byteBlock
.
Len
)}
"
);
}
};
if
(
checkBox1
.
Checked
)
{
m_udpSession
.
SetDataHandlingAdapter
(
new
UdpPackageAdapter
());
}
else
{
m_udpSession
.
SetDataHandlingAdapter
(
new
NormalUdpDataHandlingAdapter
());
}
m_udpSession
.
Setup
(
new
RRQMConfig
()
.
SetBindIPHost
(
new
IPHost
(
this
.
textBox2
.
Text
))
.
SetSingletonLogger
(
new
LoggerGroup
(
new
EasyLogger
(
this
.
ShowMsg
),
new
FileLogger
())))
...
...
@@ -44,5 +60,17 @@ namespace UdpDemoApp
{
m_udpSession
.
Send
(
new
IPHost
(
this
.
textBox3
.
Text
).
EndPoint
,
Encoding
.
UTF8
.
GetBytes
(
this
.
textBox4
.
Text
));
}
private
void
button3_Click
(
object
sender
,
EventArgs
e
)
{
try
{
m_udpSession
.
Send
(
new
IPHost
(
this
.
textBox3
.
Text
).
EndPoint
,
new
byte
[
1024
*
1024
]);
}
catch
(
Exception
ex
)
{
m_udpSession
.
Logger
.
Exception
(
ex
);
}
}
}
}
UdpDemoApp/Form1.resx
→
examples/
UdpDemoApp/Form1.resx
浏览文件 @
de941fcf
文件已移动
UdpDemoApp/Program.cs
→
examples/
UdpDemoApp/Program.cs
浏览文件 @
de941fcf
文件已移动
UdpDemoApp/UdpDemoApp.csproj
→
examples/
UdpDemoApp/UdpDemoApp.csproj
浏览文件 @
de941fcf
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录