fix: 当传递消息过大时的,websocket 接收消息的不足
This commit is contained in:
parent
617f75ba36
commit
2ffe3c4373
4 changed files with 8 additions and 7 deletions
|
@ -103,8 +103,8 @@ public class WebSocPipeLine<TSocket>(TSocket socket, bool isAES) : AbsPipeLine(i
|
|||
|
||||
protected override async Task Listen(Func<byte[], bool> receiveCb)
|
||||
{
|
||||
//warning 最大支持1MB,这由需要同步的文件数量大小决定 UTF-8 每个字符,汉字视为4个字节,数字1个 ,英文字母2个。1MB=256KB*4,25万个字符能描述就行
|
||||
var buffer = new byte[1024 * 1024];
|
||||
//warning 最大支持10MB,这由需要同步的文件数量大小决定 UTF-8 每个字符,汉字视为4个字节,数字1个 ,英文字母2个。1MB=256KB*4,25万个字符能描述就行
|
||||
var buffer = new byte[10 * 1024 * 1024];
|
||||
|
||||
while (Socket.State == WebSocketState.Open)
|
||||
{
|
||||
|
|
|
@ -41,7 +41,7 @@ if (app.Environment.IsDevelopment())
|
|||
}
|
||||
app.UseWebSockets();
|
||||
|
||||
//app.Urls.Clear();
|
||||
//app.Urls.Add("http://0.0.0.0:6819");
|
||||
app.Urls.Clear();
|
||||
app.Urls.Add("http://0.0.0.0:6819");
|
||||
app.MapControllers();
|
||||
app.Run();
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
"AllowedHosts": "*",
|
||||
"TempDir": "D:\\FileSyncTest\\dtemp",
|
||||
"NamePwds": [
|
||||
[ "Test", "t123" ]
|
||||
[ "Test", "t123" ],
|
||||
[ "FYMF", "FYMF" ]
|
||||
],
|
||||
"SqlPackageAbPath": "C:\\Users\\ZHAOLEI\\.dotnet\\tools\\sqlpackage.exe"
|
||||
}
|
||||
|
|
|
@ -6,8 +6,8 @@ class ConnectPipe {
|
|||
// this.#websocket = new WebSocket(`ws://${window.location.host}`)
|
||||
}
|
||||
OpenPipe(config, MsgCb) {
|
||||
// var webSocUrl = `ws://${window.location.host}/websoc?Name=${config.Name}`
|
||||
var webSocUrl = "ws://127.0.0.1:6818/websoc?Name=Test";
|
||||
var webSocUrl = `ws://${window.location.host}/websoc?Name=${config.Name}`
|
||||
// var webSocUrl = "ws://127.0.0.1:6818/websoc?Name=Test";
|
||||
this.#websocket = new WebSocket(webSocUrl);
|
||||
this.#websocket.onopen = (event) => {
|
||||
var starter = {
|
||||
|
|
Loading…
Reference in a new issue