Skip to content

Commit df88564

Browse files
committed
doc: 增加接收数据示例文档说明
1 parent ef82709 commit df88564

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/BootstrapBlazor.Server/Components/Samples/Sockets/Receives.razor.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace BootstrapBlazor.Server.Components.Samples.Sockets;
99

1010
/// <summary>
11-
///
11+
/// 接收电文示例
1212
/// </summary>
1313
public partial class Receives : ComponentBase, IDisposable
1414
{
@@ -27,7 +27,10 @@ protected override void OnInitialized()
2727
base.OnInitialized();
2828

2929
// 从服务中获取 Socket 实例
30-
_client = TcpSocketFactory.GetOrCreate("bb", key => new IPEndPoint(IPAddress.Loopback, 0));
30+
_client = TcpSocketFactory.GetOrCreate("bb", options =>
31+
{
32+
options.LocalEndPoint = new IPEndPoint(IPAddress.Loopback, 0);
33+
});
3134
_client.ReceivedCallBack += OnReceivedAsync;
3235
}
3336

src/BootstrapBlazor.Server/Locales/en-US.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7210,5 +7210,11 @@
72107210
"OfficeViewerNormalTitle": "Basic Usage",
72117211
"OfficeViewerNormalIntro": "Set the document URL for preview by configuring the <code>Url</code> value",
72127212
"OfficeViewerToastSuccessfulContent": "Office document loaded successfully"
7213+
},
7214+
"BootstrapBlazor.Server.Components.Samples.Sockets.Receives": {
7215+
"ReceivesTitle": "Socket Receive",
7216+
"ReceivesDescription": "Receive data through Socket and display it",
7217+
"NormalTitle": "Basic usage",
7218+
"NormalIntro": "After connecting, the timestamp data sent by the server is automatically received through the <code>ReceivedCallBack</code> callback method"
72137219
}
72147220
}

src/BootstrapBlazor.Server/Locales/zh-CN.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7210,5 +7210,11 @@
72107210
"OfficeViewerNormalTitle": "基本用法",
72117211
"OfficeViewerNormalIntro": "通过设置 <code>Url</code> 值设置预览文档地址",
72127212
"OfficeViewerToastSuccessfulContent": "Office 文档加载成功"
7213+
},
7214+
"BootstrapBlazor.Server.Components.Samples.Sockets.Receives": {
7215+
"ReceivesTitle": "Socket 接收示例",
7216+
"ReceivesDescription": "通过 Socket 接收数据并且显示",
7217+
"NormalTitle": "基本用法",
7218+
"NormalIntro": "连接后通过 <code>ReceivedCallBack</code> 回调方法自动接收服务端发送来的时间戳数据"
72137219
}
72147220
}

0 commit comments

Comments
 (0)