我们得到" Uri字符串太长了。"将大型消息从SignalR .NET客户端传递回SignalR服务器时出错。较小的消息可以正常工作。
APP错误向SignalR Server发送数据:无效的URI:Uri字符串太长。
用于将数据发送回服务器的VB.NET代码:
Private Async Function SendData(ByVal sToUser As String, ByVal sToDevice As String, ByVal sDataType As String, ByVal sData As String) As Task
Try
myEvent = New CEvent(Now, sCompanyName, "INFO", "APP", "Sending data...", 100, 100)
myEventLog.WriteCEvent(myEvent)
Await trans.Invoke("sendData", _
New String() {msSiteCode, _
sCompanyName, _
sToUser & sToDevice, _
sDataType, _
sData}).ContinueWith(Function(task)
If task.IsFaulted Then
myEvent = New CEvent(Now, sCompanyName, "ERROR", "CCMDAPP", _
"APP Error sending data to SignalR Server: " & task.Exception.Message, 100, 100)
myEventLog.WriteCEvent(myEvent)
Else
myEvent = New CEvent(Now, sCompanyName, "INFO", "CCMDAPP", _
"CCMDAPP Data sent to the SignalR Server with arguments: " & msSiteCode & " " & sCompanyName & " " & sToUser & sToDevice & " " & sData, 100, 100)
myEventLog.WriteCEvent(myEvent)
End If
End Function)
Catch ex As Exception
myEvent = New CEvent(Now, sCompanyName, "ERROR", "APP", "APP Error sending data to SignalR Server: " & ex.Message, 100, 100)
myEventLog.WriteCEvent(myEvent)
End Try
End Function
在.NET SignalR Client上为ALL启用堆栈跟踪。请注意,消息ID 3和4请求了大量未发送回服务器的数据。
06:09:38.5417500 - null - ChangeState(断开,正在连接)
06:09:42.3567500 - f933feff-b1ae-41d8-b417-1fc114fdffdb - WS连接到:wss://www.example.com/SignalRServer/signalr/connect?transport = webSockets& connectionToken = wbsXZGWLigLa%2B7btvrZ7SZWcG%2FYOjtwE8ah8yqlhZdBVP %2FoM4COAkvwqihzLOIS%2FCHT5DbdQZzmgjVVEiNs33TAAIgfahlv3rQuE%2B%2FpLeszoGPr9REr%2FmUUpZPGWj3Gj&安培; connectionData = [{"名称":"发射机"}]
06:09:42.3630000 - f933feff-b1ae-41d8-b417-1fc114fdffdb - 自动:无法连接到使用传输webSockets。 System.PlatformNotSupportedException:此平台不支持WebSocket协议。 在System.Net.WebSockets.ClientWebSocket..ctor() 在Microsoft.AspNet.SignalR.Client.Transports.WebSocketTransport.d__2.MoveNext()
06:09:42.3692500 - f933feff-b1ae-41d8-b417-1fc114fdffdb - SSE:GET https://www.example.com/SignalRServer/signalr/connect?transport=serverSentEvents&connectionToken=wbsXZGWLigLa%2B7btvrZ7SZWcG%2FYOjtwE8ah8yqlhZdBVP%2FoM4COAkvwqihzLOIS%2FCHT5DbdQZzmgjVVEiNs33TAAIgfahlv3rQuE%2B%2FpLeszoGPr9REr%2FmUUpZPGWj3Gj&connectionData=[ {" Name":" Transmitter"}]
06:09:43.1605000 - f933feff-b1ae-41d8-b417-1fc114fdffdb - SSE:OnMessage(数据:已初始化)
06:09:43.1630000 - f933feff-b1ae-41d8-b417-1fc114fdffdb - SSE:OnMessage(数据:{" C":" d-AA7FBA87-B,F0 | GF,0 | GG,1 | GH,0"" S":1," M":[{" H":"发射机&#34 ;," M":"接合"" A":[" f933feff-b1ae-41d8-b417-1fc114fdffdb"&#34 ; 19/12/2013 4:13:37 PM"]}]})
06:09:43.1817500 - f933feff-b1ae-41d8-b417-1fc114fdffdb - ChangeState(正在连接,已连接)
06:09:44.5080000 - f933feff-b1ae-41d8-b417-1fc114fdffdb - SSE:OnMessage(数据:{" C":" d-AA7FBA87-B,F0 | GF,1 | GG,1 | GH,0"" M":[{" H":"发射机"" M&#34 ;: " isLoggedIn"" A":[真,""""""]}] })
06:09:44.5080000 - f933feff-b1ae-41d8-b417-1fc114fdffdb - OnMessage({" I":" 0"})
06:09:45.4905000 - f933feff-b1ae-41d8-b417-1fc114fdffdb - SSE:OnMessage(数据:{" C":" d-AA7FBA87-B,F0 | GF,2 | GG,1 | GH,0"" M":[{" H":"发射机"" M&#34 ;: " commandSent"" A":[" {\"的MsgID \":\" 0 \" \& #34; CompanyCode \":\" ACCOUNTS:xyz SOFTWARE P / L V90 \",\" FromUser \":\" username @ example。 COM \" \" FromDevice \":\" 16 \" \"动作\":3,\"对象类型\":16,\" PARAMS \":[\" A1 \"]}"]}]})
06:09:45.5242500 - f933feff-b1ae-41d8-b417-1fc114fdffdb - SSE:OnMessage(数据:{" C":" d-AA7FBA87-B,F0 | GF,5 | GG,1 | GH,0"" M":[{" H":"发射机"" M&#34 ;: " commandSent"" A":[" {\"的MsgID \":\" 1 \" \& #34; CompanyCode \":\" ACCOUNTS:xyz SOFTWARE P / L V90 \",\" FromUser \":\" username @ example。 COM \" \" FromDevice \":\" 16 \" \"动作\":3,\" ObjectType \":36,\" Params \":[\" Job Maintenance \"]}"]},{" H&# 34;:"发射机"" M":" commandSent"" A":[" {\" MsgID \":\" 2 \",\" CompanyCode \":\" ACCOUNTS:xyz SOFTWARE P / L V90 \", \" FROMUSER \":\" username@example.com \" \" FromDevice \":\" 16 \&#34 ; \"动作\":3,\"对象类型\":23,\" PARAMS \":[\"用户名@ example.com \" \" username@example.com \" \" 0 \"]}"]},{" H":"发射机&#34 ;," M":" commandSent"" A":[" {\"的MsgID \":\&# 34; 3 \",\" CompanyCode \":\"帐户:xyz软件P / L V90 \",\" FromUser \&#34 ;:\" username@example.com \" \" FromDevice \":\" 16 \" \"动作\& #34;:3,\"对象类型\":5,\" PARAMS \":[\" \" \" ACTIVE \" \" 50 \"]}"]}]})
06:09:46.0342500 - f933feff-b1ae-41d8-b417-1fc114fdffdb - OnMessage({" I":" 1"})
06:09:46.5655000 - f933feff-b1ae-41d8-b417-1fc114fdffdb - OnMessage({" I":" 2"})
06:09:46.5680000 - f933feff-b1ae-41d8-b417-1fc114fdffdb - OnMessage({" I":" 4"})
06:09:46.6005000 - f933feff-b1ae-41d8-b417-1fc114fdffdb - OnMessage({" I":" 3"})
06:09:46.7567500 - f933feff-b1ae-41d8-b417-1fc114fdffdb - OnMessage({" I":" 5"})
06:09:47.2567500 - f933feff-b1ae-41d8-b417-1fc114fdffdb - OnMessage({" I":" 7"})
06:09:47.4930000 - f933feff-b1ae-41d8-b417-1fc114fdffdb - OnMessage({" I":" 6"})
06:10:20.4480000 - f933feff-b1ae-41d8-b417-1fc114fdffdb - SSE:OnMessage(数据:{})
06:11:20.4792500 - f933feff-b1ae-41d8-b417-1fc114fdffdb - SSE:OnMessage(数据:{})
06:12:20.5005000 - f933feff-b1ae-41d8-b417-1fc114fdffdb - SSE:OnMessage(数据:{})
06:12:50.5242500 - f933feff-b1ae-41d8-b417-1fc114fdffdb - SSE:OnMessage(数据:{" C":" d-AA7FBA87-B,F1 | GF,5 | GG,1 | GH,0"" M":[{" H":"发射机"" M&#34 ;: "离开"," A":[" 45fccfd7-5928-430f-867d-b5c7682812fc"," 19/12/2013 4:16:45 PM"]}]})
06:13:20.5280000 - f933feff-b1ae-41d8-b417-1fc114fdffdb - SSE:OnMessage(数据:{})
06:14:20.5555000 - f933feff-b1ae-41d8-b417-1fc114fdffdb - SSE:OnMessage(数据:{})
06:15:05.5292500 - f933feff-b1ae-41d8-b417-1fc114fdffdb - SSE:OnMessage(数据:{" C":" d-AA7FBA87-B,F1 | GF,6 | GG,1 | GH,0"" M":[{" H":"发射机"" M&#34 ;: " commandSent"" A":[" {\"的MsgID \":\" 4 \" \& #34; CompanyCode \":\" ACCOUNTS:xyz SOFTWARE P / L V90 \",\" FromUser \":\" username @ example。 COM \" \" FromDevice \":\" 16 \" \"动作\":3,\"对象类型\":5,\" PARAMS \":[\" \" \" ACTIVE \" \" 50 \"]}"]}]})
06:15:06.5392500 - f933feff-b1ae-41d8-b417-1fc114fdffdb - OnMessage({" I":" 9"})
环境:
我们使用异步调用,但据我们所知,我们需要异步调用以兼容Windows 8和Windows Server 2012计算机。
此外,问题出现在从信号R版本1.1.0升级到2.0.1并且没有进行其他更改的结果。在升级之前添加了异步调用。
我们可以设置一些设置来防止这种情况吗?或者这确实是SignalR 2.0.1的限制,我们需要设计一种方法来重组更大的消息?
感谢。