我尝试与 SignalR ised 和 ASP.Net (VB) 聊天 运行时,与第一个用户完美配合,但与另一个用户登录时出现错误:
错误:溢出
请帮忙,我是实时应用程序的新手
Public Overrides Function OnConnected() As Task
Dim myRoomId = "XXXX"
Dim myUserId = IdentityUser.UserCode
SyncLock connections
If Not connections.ContainsKey(myRoomId) Then
connections(myRoomId) = New Dictionary(Of Integer, List(Of String))()
End If
If Not connections(myRoomId).ContainsKey(myUserId) Then ' <<<<<--- Error
connections(myRoomId)(myUserId) = New List(Of String)()
End If
connections(myRoomId)(myUserId).Add(Me.Context.ConnectionId)
End SyncLock
Return MyBase.OnConnected()
End Function