deniszykov / WebSocketListener

A lightweight and highly scalable asynchronous WebSocket listener
http://vtortola.github.io/WebSocketListener
81 stars 17 forks source link

High CPU usage running under mono #51

Closed NateKomodo closed 4 years ago

NateKomodo commented 4 years ago

I have set this up like so:

    async Task Read()
    {
        while (ws.IsConnected && !ct.IsCancellationRequested)
        {
           String msg = await ws.ReadStringAsync(ct).ConfigureAwait(false);
        }
    }

However, while this is running, CPU usage skyrockets to 100% and does not go back down until this code stops running. How can i resolve this?

NateKomodo commented 4 years ago

Issue was elsewhere (There was an infinite while loop running while connected i had forgot to clean up)