SampleSmart
1.0.0.0
SampleSmart 사용 방법을 보여 주는 예제 프로젝트입니다.
Toggle main menu visibility
로딩중...
검색중...
일치하는것 없음
UdpPeerTestView.xaml.Event.cs
이 파일의 문서화 페이지로 가기
1
using
Dreamine.Communication.Core.Protocols;
2
using
SampleSmart.Pages.PageSub.CommunicationTabs
;
3
4
namespace
SampleSmart.Pages.PageSub.CommunicationTabs.Udp
;
5
14
public
sealed
class
UdpPeerTestViewEvent
15
{
24
private
readonly
CommunicationSampleRuntime
_runtime
;
25
50
public
UdpPeerTestViewEvent
(
CommunicationSampleRuntime
runtime)
51
{
52
_runtime
= runtime ??
throw
new
ArgumentNullException(nameof(runtime));
53
54
SelectedUdpProtocol
=
"PlainText"
;
55
SelectedUdpEncoding
= PlainTextProtocolOptions.Utf8EncodingName;
56
UdpSendText
=
"Hello from Dreamine UDP Peer"
;
57
}
58
67
public
IReadOnlyList<string>
UdpProtocols
=>
_runtime
.UdpProtocols;
68
77
public
string
SelectedUdpProtocol
{
get
;
set
; }
78
87
public
IReadOnlyList<string>
UdpTextEncodings
=>
_runtime
.UdpTextEncodings;
88
97
public
string
SelectedUdpEncoding
{
get
;
set
; }
98
107
public
string
UdpSendText
{
get
;
set
; }
108
117
public
string
UdpEndpointSummary
=>
"Peer A: 127.0.0.1:16001 -> 127.0.0.1:16002 / Peer B: 127.0.0.1:16002 -> 127.0.0.1:16001"
;
118
127
public
void
StartUdpLoopback
()
128
{
129
_ =
_runtime
.StartUdpLoopbackAsync(
130
SelectedUdpProtocol
,
131
SelectedUdpEncoding
);
132
}
133
142
public
void
StopUdpLoopback
()
143
{
144
_ =
_runtime
.StopAllUdpAsync();
145
}
146
155
public
void
ConnectUdpPeerA
()
156
{
157
_ =
_runtime
.ConnectUdpPeerAAsync(
158
SelectedUdpProtocol
,
159
SelectedUdpEncoding
);
160
}
161
170
public
void
ConnectUdpPeerB
()
171
{
172
_ =
_runtime
.ConnectUdpPeerBAsync(
173
SelectedUdpProtocol
,
174
SelectedUdpEncoding
);
175
}
176
185
public
void
DisconnectUdpPeerA
()
186
{
187
_ =
_runtime
.DisconnectUdpPeerAAsync();
188
}
189
198
public
void
DisconnectUdpPeerB
()
199
{
200
_ =
_runtime
.DisconnectUdpPeerBAsync();
201
}
202
211
public
void
SendUdpPeerA
()
212
{
213
_ =
_runtime
.SendUdpPeerAAsync(
214
SelectedUdpProtocol
,
215
UdpSendText
,
216
SelectedUdpEncoding
);
217
}
218
227
public
void
SendUdpPeerB
()
228
{
229
_ =
_runtime
.SendUdpPeerBAsync(
230
SelectedUdpProtocol
,
231
UdpSendText
,
232
SelectedUdpEncoding
);
233
}
234
}
SampleSmart.Pages.PageSub.CommunicationTabs
Definition
CommunicationSampleRuntime.cs:21
SampleSmart.Pages.PageSub.CommunicationTabs.Udp
Definition
UdpPeerTestView.xaml.cs:5
SampleSmart.Pages.PageSub.CommunicationTabs.CommunicationSampleRuntime
Definition
CommunicationSampleRuntime.cs:40
SampleSmart.Pages.PageSub.CommunicationTabs.Udp.UdpPeerTestViewEvent.SendUdpPeerB
void SendUdpPeerB()
Definition
UdpPeerTestView.xaml.Event.cs:227
SampleSmart.Pages.PageSub.CommunicationTabs.Udp.UdpPeerTestViewEvent._runtime
readonly CommunicationSampleRuntime _runtime
Definition
UdpPeerTestView.xaml.Event.cs:24
SampleSmart.Pages.PageSub.CommunicationTabs.Udp.UdpPeerTestViewEvent.UdpProtocols
IReadOnlyList< string > UdpProtocols
Definition
UdpPeerTestView.xaml.Event.cs:67
SampleSmart.Pages.PageSub.CommunicationTabs.Udp.UdpPeerTestViewEvent.StopUdpLoopback
void StopUdpLoopback()
Definition
UdpPeerTestView.xaml.Event.cs:142
SampleSmart.Pages.PageSub.CommunicationTabs.Udp.UdpPeerTestViewEvent.DisconnectUdpPeerA
void DisconnectUdpPeerA()
Definition
UdpPeerTestView.xaml.Event.cs:185
SampleSmart.Pages.PageSub.CommunicationTabs.Udp.UdpPeerTestViewEvent.SelectedUdpEncoding
string SelectedUdpEncoding
Definition
UdpPeerTestView.xaml.Event.cs:97
SampleSmart.Pages.PageSub.CommunicationTabs.Udp.UdpPeerTestViewEvent.UdpPeerTestViewEvent
UdpPeerTestViewEvent(CommunicationSampleRuntime runtime)
Definition
UdpPeerTestView.xaml.Event.cs:50
SampleSmart.Pages.PageSub.CommunicationTabs.Udp.UdpPeerTestViewEvent.ConnectUdpPeerB
void ConnectUdpPeerB()
Definition
UdpPeerTestView.xaml.Event.cs:170
SampleSmart.Pages.PageSub.CommunicationTabs.Udp.UdpPeerTestViewEvent.SendUdpPeerA
void SendUdpPeerA()
Definition
UdpPeerTestView.xaml.Event.cs:211
SampleSmart.Pages.PageSub.CommunicationTabs.Udp.UdpPeerTestViewEvent.UdpSendText
string UdpSendText
Definition
UdpPeerTestView.xaml.Event.cs:107
SampleSmart.Pages.PageSub.CommunicationTabs.Udp.UdpPeerTestViewEvent.DisconnectUdpPeerB
void DisconnectUdpPeerB()
Definition
UdpPeerTestView.xaml.Event.cs:198
SampleSmart.Pages.PageSub.CommunicationTabs.Udp.UdpPeerTestViewEvent.SelectedUdpProtocol
string SelectedUdpProtocol
Definition
UdpPeerTestView.xaml.Event.cs:77
SampleSmart.Pages.PageSub.CommunicationTabs.Udp.UdpPeerTestViewEvent.StartUdpLoopback
void StartUdpLoopback()
Definition
UdpPeerTestView.xaml.Event.cs:127
SampleSmart.Pages.PageSub.CommunicationTabs.Udp.UdpPeerTestViewEvent.UdpEndpointSummary
string UdpEndpointSummary
Definition
UdpPeerTestView.xaml.Event.cs:117
SampleSmart.Pages.PageSub.CommunicationTabs.Udp.UdpPeerTestViewEvent.UdpTextEncodings
IReadOnlyList< string > UdpTextEncodings
Definition
UdpPeerTestView.xaml.Event.cs:87
SampleSmart.Pages.PageSub.CommunicationTabs.Udp.UdpPeerTestViewEvent.ConnectUdpPeerA
void ConnectUdpPeerA()
Definition
UdpPeerTestView.xaml.Event.cs:155
Pages
PageSub
CommunicationTabs
Udp
UdpPeerTestView.xaml.Event.cs
다음에 의해 생성됨 :
1.17.0