SampleSmart 1.0.0.0
SampleSmart 사용 방법을 보여 주는 예제 프로젝트입니다.
로딩중...
검색중...
일치하는것 없음
UdpPeerTestView.xaml.Event.cs
이 파일의 문서화 페이지로 가기
1using Dreamine.Communication.Core.Protocols;
3
5
14public sealed class UdpPeerTestViewEvent
15{
25
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(
132 }
133
142 public void StopUdpLoopback()
143 {
144 _ = _runtime.StopAllUdpAsync();
145 }
146
155 public void ConnectUdpPeerA()
156 {
157 _ = _runtime.ConnectUdpPeerAAsync(
160 }
161
170 public void ConnectUdpPeerB()
171 {
172 _ = _runtime.ConnectUdpPeerBAsync(
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(
217 }
218
227 public void SendUdpPeerB()
228 {
229 _ = _runtime.SendUdpPeerBAsync(
233 }
234}