SampleSmart
1.0.0.0
SampleSmart 사용 방법을 보여 주는 예제 프로젝트입니다.
Toggle main menu visibility
로딩중...
검색중...
일치하는것 없음
TcpLoopbackTestView.xaml.Event.cs
이 파일의 문서화 페이지로 가기
1
using
Dreamine.Communication.Core.Protocols;
2
3
namespace
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp
;
4
13
public
sealed
class
TcpLoopbackTestViewEvent
14
{
23
private
readonly
CommunicationSampleRuntime
_runtime
;
24
49
public
TcpLoopbackTestViewEvent
(
CommunicationSampleRuntime
runtime)
50
{
51
_runtime
= runtime ??
throw
new
ArgumentNullException(nameof(runtime));
52
53
SelectedTcpLoopbackProtocol
=
"PlainText"
;
54
SelectedTcpLoopbackEncoding
= PlainTextProtocolOptions.Utf8EncodingName;
55
TcpLoopbackSendText
=
"Hello from Dreamine TCP Loopback"
;
56
}
57
66
public
IReadOnlyList<string>
TcpLoopbackProtocols
=>
_runtime
.TcpProtocols;
67
76
public
IReadOnlyList<string>
TcpLoopbackEncodings
=>
_runtime
.TextEncodings;
77
86
public
string
SelectedTcpLoopbackProtocol
{
get
;
set
; }
87
96
public
string
SelectedTcpLoopbackEncoding
{
get
;
set
; }
97
106
public
string
TcpLoopbackSendText
{
get
;
set
; }
107
116
public
void
StartLoopback
()
117
{
118
_ =
StartLoopbackAsync
();
119
}
120
129
public
void
StopLoopback
()
130
{
131
_ =
_runtime
.StopAllTcpAsync();
132
}
133
142
public
void
SendClient
()
143
{
144
_ =
_runtime
.SendTcpClientAsync(
145
SelectedTcpLoopbackProtocol
,
146
TcpLoopbackSendText
,
147
SelectedTcpLoopbackEncoding
);
148
}
149
158
public
void
SendServer
()
159
{
160
_ =
_runtime
.SendTcpServerAsync(
161
SelectedTcpLoopbackProtocol
,
162
TcpLoopbackSendText
,
163
SelectedTcpLoopbackEncoding
);
164
}
165
182
private
async Task
StartLoopbackAsync
()
183
{
184
await
_runtime
.StartTcpServerAsync(
185
SelectedTcpLoopbackProtocol
,
186
SelectedTcpLoopbackEncoding
);
187
188
await
_runtime
.ConnectTcpClientAsync(
189
SelectedTcpLoopbackProtocol
,
190
SelectedTcpLoopbackEncoding
);
191
}
192
}
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp
Definition
TcpClientTestView.xaml.cs:4
SampleSmart.Pages.PageSub.CommunicationTabs.CommunicationSampleRuntime
Definition
CommunicationSampleRuntime.cs:40
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpLoopbackTestViewEvent.StopLoopback
void StopLoopback()
Definition
TcpLoopbackTestView.xaml.Event.cs:129
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpLoopbackTestViewEvent.TcpLoopbackProtocols
IReadOnlyList< string > TcpLoopbackProtocols
Definition
TcpLoopbackTestView.xaml.Event.cs:66
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpLoopbackTestViewEvent._runtime
readonly CommunicationSampleRuntime _runtime
Definition
TcpLoopbackTestView.xaml.Event.cs:23
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpLoopbackTestViewEvent.TcpLoopbackTestViewEvent
TcpLoopbackTestViewEvent(CommunicationSampleRuntime runtime)
Definition
TcpLoopbackTestView.xaml.Event.cs:49
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpLoopbackTestViewEvent.StartLoopback
void StartLoopback()
Definition
TcpLoopbackTestView.xaml.Event.cs:116
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpLoopbackTestViewEvent.StartLoopbackAsync
async Task StartLoopbackAsync()
Definition
TcpLoopbackTestView.xaml.Event.cs:182
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpLoopbackTestViewEvent.SelectedTcpLoopbackProtocol
string SelectedTcpLoopbackProtocol
Definition
TcpLoopbackTestView.xaml.Event.cs:86
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpLoopbackTestViewEvent.TcpLoopbackSendText
string TcpLoopbackSendText
Definition
TcpLoopbackTestView.xaml.Event.cs:106
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpLoopbackTestViewEvent.SendServer
void SendServer()
Definition
TcpLoopbackTestView.xaml.Event.cs:158
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpLoopbackTestViewEvent.SendClient
void SendClient()
Definition
TcpLoopbackTestView.xaml.Event.cs:142
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpLoopbackTestViewEvent.TcpLoopbackEncodings
IReadOnlyList< string > TcpLoopbackEncodings
Definition
TcpLoopbackTestView.xaml.Event.cs:76
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpLoopbackTestViewEvent.SelectedTcpLoopbackEncoding
string SelectedTcpLoopbackEncoding
Definition
TcpLoopbackTestView.xaml.Event.cs:96
Pages
PageSub
CommunicationTabs
Tcp
TcpLoopbackTestView.xaml.Event.cs
다음에 의해 생성됨 :
1.17.0