SampleSmart
1.0.0.0
SampleSmart 사용 방법을 보여 주는 예제 프로젝트입니다.
Toggle main menu visibility
로딩중...
검색중...
일치하는것 없음
TcpServerTestView.xaml.Event.cs
이 파일의 문서화 페이지로 가기
1
using
Dreamine.Communication.Core.Protocols;
2
using
Dreamine.Communication.Sockets.Enums;
3
using
SampleSmart.Pages.PageSub.CommunicationTabs
;
4
5
namespace
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp
;
6
15
public
sealed
class
TcpServerTestViewEvent
16
{
25
private
readonly
CommunicationSampleRuntime
_runtime
;
26
51
public
TcpServerTestViewEvent
(
CommunicationSampleRuntime
runtime)
52
{
53
_runtime
= runtime ??
throw
new
ArgumentNullException(nameof(runtime));
54
55
SelectedTcpServerProtocol
=
"RawAvailable"
;
56
SelectedTcpServerEncoding
= PlainTextProtocolOptions.Utf8EncodingName;
57
SelectedTcpServerSendTargetMode
= nameof(TcpServerSendTargetMode.Broadcast);
58
IsTcpServerEchoEnabled
=
false
;
59
TcpServerSendText
=
"Hello from Dreamine TCP Server"
;
60
}
61
70
public
IReadOnlyList<string>
TcpServerProtocols
=>
_runtime
.TcpProtocols;
71
80
public
IReadOnlyList<string>
TcpServerEncodings
=>
_runtime
.TextEncodings;
81
90
public
IReadOnlyList<string>
TcpServerSendTargetModes
=>
_runtime
.TcpServerSendTargetModes;
91
100
public
string
SelectedTcpServerProtocol
{
get
;
set
; }
101
110
public
string
SelectedTcpServerEncoding
{
get
;
set
; }
111
120
public
string
SelectedTcpServerSendTargetMode
{
get
;
set
; }
121
130
public
bool
IsTcpServerEchoEnabled
{
get
;
set
; }
131
140
public
string
TcpServerSendText
{
get
;
set
; }
141
150
public
void
StartServer
()
151
{
152
_ =
_runtime
.StartTcpServerAsync(
153
SelectedTcpServerProtocol
,
154
SelectedTcpServerEncoding
,
155
SelectedTcpServerSendTargetMode
,
156
IsTcpServerEchoEnabled
);
157
}
158
167
public
void
StopServer
()
168
{
169
_ =
_runtime
.StopTcpServerAsync();
170
}
171
180
public
void
ApplyServerOptions
()
181
{
182
_runtime
.UpdateTcpServerOptions(
183
SelectedTcpServerProtocol
,
184
SelectedTcpServerEncoding
,
185
SelectedTcpServerSendTargetMode
,
186
IsTcpServerEchoEnabled
);
187
}
188
197
public
void
SendServer
()
198
{
199
_ =
_runtime
.SendTcpServerAsync(
200
SelectedTcpServerProtocol
,
201
TcpServerSendText
,
202
SelectedTcpServerEncoding
,
203
SelectedTcpServerSendTargetMode
);
204
}
205
}
SampleSmart.Pages.PageSub.CommunicationTabs
Definition
CommunicationSampleRuntime.cs:21
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp
Definition
TcpClientTestView.xaml.cs:4
SampleSmart.Pages.PageSub.CommunicationTabs.CommunicationSampleRuntime
Definition
CommunicationSampleRuntime.cs:40
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpServerTestViewEvent.StopServer
void StopServer()
Definition
TcpServerTestView.xaml.Event.cs:167
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpServerTestViewEvent.SelectedTcpServerSendTargetMode
string SelectedTcpServerSendTargetMode
Definition
TcpServerTestView.xaml.Event.cs:120
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpServerTestViewEvent.ApplyServerOptions
void ApplyServerOptions()
Definition
TcpServerTestView.xaml.Event.cs:180
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpServerTestViewEvent.SendServer
void SendServer()
Definition
TcpServerTestView.xaml.Event.cs:197
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpServerTestViewEvent.IsTcpServerEchoEnabled
bool IsTcpServerEchoEnabled
Definition
TcpServerTestView.xaml.Event.cs:130
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpServerTestViewEvent.SelectedTcpServerProtocol
string SelectedTcpServerProtocol
Definition
TcpServerTestView.xaml.Event.cs:100
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpServerTestViewEvent.StartServer
void StartServer()
Definition
TcpServerTestView.xaml.Event.cs:150
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpServerTestViewEvent._runtime
readonly CommunicationSampleRuntime _runtime
Definition
TcpServerTestView.xaml.Event.cs:25
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpServerTestViewEvent.TcpServerSendTargetModes
IReadOnlyList< string > TcpServerSendTargetModes
Definition
TcpServerTestView.xaml.Event.cs:90
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpServerTestViewEvent.SelectedTcpServerEncoding
string SelectedTcpServerEncoding
Definition
TcpServerTestView.xaml.Event.cs:110
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpServerTestViewEvent.TcpServerEncodings
IReadOnlyList< string > TcpServerEncodings
Definition
TcpServerTestView.xaml.Event.cs:80
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpServerTestViewEvent.TcpServerProtocols
IReadOnlyList< string > TcpServerProtocols
Definition
TcpServerTestView.xaml.Event.cs:70
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpServerTestViewEvent.TcpServerTestViewEvent
TcpServerTestViewEvent(CommunicationSampleRuntime runtime)
Definition
TcpServerTestView.xaml.Event.cs:51
SampleSmart.Pages.PageSub.CommunicationTabs.Tcp.TcpServerTestViewEvent.TcpServerSendText
string TcpServerSendText
Definition
TcpServerTestView.xaml.Event.cs:140
Pages
PageSub
CommunicationTabs
Tcp
TcpServerTestView.xaml.Event.cs
다음에 의해 생성됨 :
1.17.0