Coder Social home page Coder Social logo

Error while stopping client, message: 'The WebSocket is in an invalid state ('Closed') for this operation. Valid states are: 'Open, CloseReceived about socket.io-client-csharp HOT 2 CLOSED

doghappy avatar doghappy commented on August 18, 2024
Error while stopping client, message: 'The WebSocket is in an invalid state ('Closed') for this operation. Valid states are: 'Open, CloseReceived

from socket.io-client-csharp.

Comments (2)

doghappy avatar doghappy commented on August 18, 2024

I use the latest preview version(1.0.3.13-alpha), the following is the Console output

static async Task Main(string[] args)
{
    try
    {
        var client = new SocketIO("https://socket.stex.com/");
        client.On("App\\Events\\GlassRowChanged", res => { Console.WriteLine(res.Text); }, res =>
        {
            Console.WriteLine(DateTime.Now);
            Console.WriteLine(res.Text);
        });

        client.OnConnected += async () =>
        {
            var obj = new
            {
                channel = $"orderbook_data147",
                auth = new { }
            };

            await client.EmitAsync("subscribe", obj);
        };

        await client.ConnectAsync();
    }
    catch (Exception ex)
    {
        Console.WriteLine("Failed to process order book items");
        Console.WriteLine(ex.ToString());
    }

    Console.WriteLine("--");
    Console.ReadLine();
}
PS C:\Users\XXX\source\repos\ConsoleApp3\ConsoleApp3>  .\bin\Debug\ConsoleApp3.exe
--
"orderbook_data147"
2020/5/7 12:20:36
{"currency_pair_id":147,"amount":561220.01921663,"price":"0.00000169","amount2":"0.94846183","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 12:20:36
{"currency_pair_id":147,"amount":422733.88164432,"price":"0.00000169","amount2":"0.71442025","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 12:20:36
{"currency_pair_id":147,"amount":0,"price":"0.00000169","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 12:20:36
{"currency_pair_id":147,"amount":0,"price":"0.00000169","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 12:20:36
{"currency_pair_id":147,"amount":0,"price":"0.00000169","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 12:20:36
{"currency_pair_id":147,"amount":0,"price":"0.00000169","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 12:23:43
{"currency_pair_id":147,"amount":0,"price":"0.00000169","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 12:23:43
{"currency_pair_id":147,"amount":566367.64359481,"price":"0.00000169","amount2":"0.95716131","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 12:23:43
{"currency_pair_id":147,"amount":0,"price":"0.00000169","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 12:32:04
{"currency_pair_id":147,"amount":191587.76383708,"price":"0.00000166","amount2":"0.31803568","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 12:32:04
{"currency_pair_id":147,"amount":0,"price":"0.00000166","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 12:32:04
{"currency_pair_id":147,"amount":0,"price":"0.00000166","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 12:34:52
{"currency_pair_id":147,"amount":514255.05554607,"price":"0.00000169","amount2":"0.86909104","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 12:34:52
{"currency_pair_id":147,"amount":0,"price":"0.00000169","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 12:34:52
{"currency_pair_id":147,"amount":0,"price":"0.00000169","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 12:38:14
{"currency_pair_id":147,"amount":565933.47637407,"price":"0.00000167","amount2":"0.94510890","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 12:38:14
{"currency_pair_id":147,"amount":0,"price":"0.00000167","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 12:38:14
{"currency_pair_id":147,"amount":0,"price":"0.00000167","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 12:43:16
{"currency_pair_id":147,"amount":549151.17778843,"price":"0.00000169","amount2":"0.92806549","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 12:43:16
{"currency_pair_id":147,"amount":0,"price":"0.00000169","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 12:43:16
{"currency_pair_id":147,"amount":0,"price":"0.00000169","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 12:44:26
{"currency_pair_id":147,"amount":0,"price":"0.00000167","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 12:44:26
{"currency_pair_id":147,"amount":0,"price":"0.00000167","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 12:44:26
{"currency_pair_id":147,"amount":393635.99684841,"price":"0.00000167","amount2":"0.65737211","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 12:54:37
{"currency_pair_id":147,"amount":0,"price":"0.00000167","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 12:54:37
{"currency_pair_id":147,"amount":0,"price":"0.00000167","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 12:54:37
{"currency_pair_id":147,"amount":457161.0498161,"price":"0.00000167","amount2":"0.76345895","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 12:55:07
{"currency_pair_id":147,"amount":0,"price":"0.00000166","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 12:55:07
{"currency_pair_id":147,"amount":0,"price":"0.00000166","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 12:55:07
{"currency_pair_id":147,"amount":694882.28875545,"price":"0.00000166","amount2":"1.15350459","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 12:58:01
{"currency_pair_id":147,"amount":259595.09750933,"price":"0.00000167","amount2":"0.43352381","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 12:58:01
{"currency_pair_id":147,"amount":0,"price":"0.00000167","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 12:58:01
{"currency_pair_id":147,"amount":0,"price":"0.00000167","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:02:28
{"currency_pair_id":147,"amount":214132.15387052,"price":"0.00000166","amount2":"0.35545937","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:02:28
{"currency_pair_id":147,"amount":0,"price":"0.00000166","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:02:28
{"currency_pair_id":147,"amount":0,"price":"0.00000166","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:13:08
{"currency_pair_id":147,"amount":0,"price":"0.00000169","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:13:08
{"currency_pair_id":147,"amount":0,"price":"0.00000169","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:13:08
{"currency_pair_id":147,"amount":716205.98171323,"price":"0.00000169","amount2":"1.21038810","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:13:55
{"currency_pair_id":147,"amount":"202.56545600","price":"0.00000165","amount2":"0.00033423","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:13:55
{"currency_pair_id":147,"amount":"0.00000000","price":"0.00000165","amount2":"0.00000000","count":0,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:13:55
{"currency_pair_id":147,"amount":"329594.00254400","price":"0.00000165","amount2":"0.54383010","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:20:32
{"currency_pair_id":147,"amount":"203.22230000","price":"0.00000172","amount2":"0.00034954","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:20:41
{"currency_pair_id":147,"amount":"203.28888223","price":"0.00000171","amount2":"0.00034762","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:21:00
{"currency_pair_id":147,"amount":"20203.88223000","price":"0.00000170","amount2":"0.03434660","count":2,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:21:18
{"currency_pair_id":147,"amount":"203.88888822","price":"0.00000169","amount2":"0.00034457","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:32:00
{"currency_pair_id":147,"amount":"0.00000000","price":"0.00000165","amount2":"0.00000000","count":0,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:32:22
{"currency_pair_id":147,"amount":"0.00000000","price":"0.00000164","amount2":"0.00000000","count":0,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:32:22
{"currency_pair_id":147,"amount":"329391.44311600","price":"0.00000164","amount2":"0.54020197","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:33:14
{"currency_pair_id":147,"amount":"0.00000000","price":"0.00000164","amount2":"0.00000000","count":0,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:34:15
{"currency_pair_id":147,"amount":"0.00000000","price":"0.00000163","amount2":"0.00000000","count":0,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:34:15
{"currency_pair_id":147,"amount":"202.56545600","price":"0.00000163","amount2":"0.00033018","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:34:18
{"currency_pair_id":147,"amount":"0.00000000","price":"0.00000162","amount2":"0.00000000","count":0,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:34:18
{"currency_pair_id":147,"amount":"0.00000000","price":"0.00000161","amount2":"0.00000000","count":0,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:34:18
{"currency_pair_id":147,"amount":"25000.00000000","price":"0.00000160","amount2":"0.04000000","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:34:18
{"currency_pair_id":147,"amount":"0.00000000","price":"0.00000160","amount2":"0.00000000","count":0,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:34:18
{"currency_pair_id":147,"amount":"1951969.00628931","price":"0.00000159","amount2":"3.10363072","count":2,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:34:18
{"currency_pair_id":147,"amount":"0.00000000","price":"0.00000159","amount2":"0.00000000","count":0,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:34:18
{"currency_pair_id":147,"amount":"1950238.24528302","price":"0.00000159","amount2":"3.10087881","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:34:18
{"currency_pair_id":147,"amount":"1648798.99561815","price":"0.00000159","amount2":"2.62159040","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:34:40
{"currency_pair_id":147,"amount":360608.24788462,"price":"0.00000168","amount2":"0.60582185","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:34:40
{"currency_pair_id":147,"amount":0,"price":"0.00000168","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:34:40
{"currency_pair_id":147,"amount":0,"price":"0.00000168","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:34:58
{"currency_pair_id":147,"amount":201620.32204997,"price":"0.00000160","amount2":"0.32259251","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:34:58
{"currency_pair_id":147,"amount":0,"price":"0.00000160","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:34:58
{"currency_pair_id":147,"amount":0,"price":"0.00000160","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:37:01
{"currency_pair_id":147,"amount":"202.33440000","price":"0.00000168","amount2":"0.00033992","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:37:19
{"currency_pair_id":147,"amount":"202.33222440","price":"0.00000167","amount2":"0.00033789","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:37:37
{"currency_pair_id":147,"amount":"202.78782244","price":"0.00000166","amount2":"0.00033663","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:37:56
{"currency_pair_id":147,"amount":"202.78000000","price":"0.00000165","amount2":"0.00033459","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:38:14
{"currency_pair_id":147,"amount":0,"price":"0.00000163","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:38:14
{"currency_pair_id":147,"amount":0,"price":"0.00000163","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"SELL","socket":null}
"orderbook_data147"
2020/5/7 13:38:14
{"currency_pair_id":147,"amount":260531.95984352,"price":"0.00000163","amount2":"0.42466709","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:38:23
{"currency_pair_id":147,"amount":0,"price":"0.00000163","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:38:23
{"currency_pair_id":147,"amount":423218.46424806,"price":"0.00000163","amount2":"0.68984609","count":1,"cumulative_amount":0,"type":"BUY","socket":null}
"orderbook_data147"
2020/5/7 13:38:23
{"currency_pair_id":147,"amount":0,"price":"0.00000163","amount2":"0.00000000","count":1,"cumulative_amount":0,"type":"SELL","socket":null}

from socket.io-client-csharp.

doghappy avatar doghappy commented on August 18, 2024

If version 2.0.0-beta.1 still hasn't fixed it, please turn it on again

from socket.io-client-csharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.