我正在使用 Websocket4Net 连接到服务器,当我发送一条消息时,我收到了该消息的回复,当我发送第二条消息时,我确实得到了回复!
当我重新启动连接并再次发送第二条消息时,我收到了回复!
所以,在同一个会话中,我只收到第一条发送消息的回复,而不是第二条、第三条等的回复……
这是我用来连接服务器的代码:
WSIWebSocket = New WebSocket(FinalURL)
WSIWebSocket.Security.AllowNameMismatchCertificate = True
WSIWebSocket.Security.AllowCertificateChainErrors = True
WSIWebSocket.Security.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls
WSIWebSocket.Security.AllowUnstrustedCertificate = True
AddHandler WSIWebSocket.Opened, AddressOf WSIWebSocket_Opened
AddHandler WSIWebSocket.Error, AddressOf WSIWebSocket_Error
AddHandler WSIWebSocket.Closed, AddressOf WSIWebSocket_Closed
AddHandler WSIWebSocket.MessageReceived, AddressOf WSIWebSocket_MessageReceived
WSIWebSocket.Open()