Skip to content
This repository was archived by the owner on Oct 19, 2019. It is now read-only.
This repository was archived by the owner on Oct 19, 2019. It is now read-only.

Conflict NewMessageReceived event #51

Description

@tondar20

After multiple clients send different messages at the same time, all events fire, but all messages are the same as the last client's message that arrived. It appears as if the last client's message creates a conflict and destroys the previous messages.

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Dim MyWebSocket As WebSocketServer = New WebSocketServer()
    MyWebSocket.Setup(prot)
    MyWebSocket.Start()

    AddHandler MyWebSocket.NewMessageReceived, AddressOf MyWebSocket_NewMessageReceived
End Sub

event:

Private Sub MyWebSocket_NewMessageReceived(session As WebSocketSession, value As String)
    Invoke(Sub()
               ListBox1.Items.Add(value)
           End Sub)
End Sub

If two clients send a message at the same time, for example:
Client1.Send("Data1")
Client2.Send("Data2")
then ListBox1.Items are Data2, Data2.

What's the solution?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions