Websocket connection disconnected. Error info: Connection to remote host was lost. Connection to remote host was lost.


  • Error info: Connection to remote host was lost. Connection to remote host was lost.

    What I did now just to reconnect it so that my program doesn't stop:
    61818bd6-6ec8-42a2-b523-bb336309d7b5-image.png

    This is bad implementation as it is continuously spawning new threads leading to the slower execution of program and then it lags for around a minute or so.

    Please provide a solution to reconnect on failure in case it happens. Though, failure should not happen in the first place.

    I tried getting all the errors which I caught in the on_error:

    Connection to remote host was lost.
    Connection to remote host was lost.
    [WinError 10053] An established connection was aborted by the software in your host machine
    [WinError 10053] An established connection was aborted by the software in your host machine
    [WinError 10053] An established connection was aborted by the software in your host machine
    [WinError 10053] An established connection was aborted by the software in your host machine
    [WinError 10054] An existing connection was forcibly closed by the remote host
    [WinError 10053] An established connection was aborted by the software in your host machine
    Connection to remote host was lost.
    [WinError 10054] An existing connection was forcibly closed by the remote host
    [WinError 10054] An existing connection was forcibly closed by the remote host
    [WinError 10054] An existing connection was forcibly closed by the remote host
    [WinError 10054] An existing connection was forcibly closed by the remote host
    [WinError 10053] An established connection was aborted by the software in your host machine
    [WinError 10053] An established connection was aborted by the software in your host machine
    [WinError 10054] An existing connection was forcibly closed by the remote host
    [WinError 10053] An established connection was aborted by the software in your host machine
    [WinError 10053] An established connection was aborted by the software in your host machine
    [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:2633)
    [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:2633)
    [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:2633)
    [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:2633)
    [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:2633)
    [WinError 10054] An existing connection was forcibly closed by the remote host
    [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:2633)
    [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:2633)
    [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:2633)
    [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:2633)
    [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:2633)
    [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:2633)
    [WinError 10054] An existing connection was forcibly closed by the remote host
    [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:2633)
    [WinError 10054] An existing connection was forcibly closed by the remote host
    [WinError 10054] An existing connection was forcibly closed by the remote host
    [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:2633)
    [WinError 10054] An existing connection was forcibly closed by the remote host
    [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:2633)
    [WinError 10054] An existing connection was forcibly closed by the remote host
    [WinError 10054] An existing connection was forcibly closed by the remote host
    [WinError 10054] An existing connection was forcibly closed by the remote host
    [WinError 10054] An existing connection was forcibly closed by the remote host
    [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:2633)
    [WinError 10054] An existing connection was forcibly closed by the remote host

    So captured around 43 errors and connected again 43 times (new threads each time - without an option to stop the previous thread) before the program actually stopped.


  • @anuragbaheti Ok, but please include the high and open data soon.


  • @admin Also, there is lag in data received via websocket.

    58bf6d39-438d-4bdd-8c43-f6f2d83a4ac3-image.png

    As you can see, at current time, 11:25:03, I am getting data for 11:24:11.


  • HI @anuragbaheti Currently we dont provide that we are evaluating options on that.


  • @admin Thank you. Will check in this. But I am still not getting high and open price data in the websocket data.

    Please check the sample data recd:

    {"ap": "351.21", "bp": "350.10", "bq": "4511", "bs": "764", "c": "352.70", "cng": "-02.40", "e": "nse_cm", "lo": "348.20", "ltp": "350.30", "ltq": "75", "ltt": "16/06/2021 11:03:39", "name": "sf", "nc": "-00.6805", "sp": "350.30", "tbq": "1381564", "tk": "3456", "to": "3829152720.24", "tsq": "2916951", "v": "10902744"}

    {"ap": "2232.20", "bp": "2217.50", "bq": "50", "bs": "70", "c": "2250.00", "cng": "-32.05", "e": "nse_cm", "lo": "2213.35", "ltp": "2217.95", "ltq": "10", "ltt": "16/06/2021 11:03:39", "name": "sf", "nc": "-01.4244", "sp": "2217.95", "tbq": "276111", "tk": "2885", "to": "5057877246.20", "tsq": "560644", "v": "2265871"}

    {"ap": "675.06", "bp": "669.70", "bq": "1320", "bs": "1248", "c": "673.20", "cng": "-03.30", "e": "nse_cm", "lo": "668.10", "ltp": "669.90", "ltq": "5", "ltt": "16/06/2021 11:03:40", "name": "sf", "nc": "-00.4902", "sp": "669.90", "tbq": "358804", "tk": "3351", "to": "1452316658.34", "tsq": "720433", "v": "2151389"}

    {"ap": "1155.33", "bp": "1142.05", "bq": "301", "bs": "95", "c": "1174.30", "cng": "-31.95", "e": "nse_cm", "lo": "1131.65", "ltp": "1142.35", "ltq": "105", "ltt": "16/06/2021 11:03:40", "name": "sf", "nc": "-02.7208", "sp": "1142.35", "tbq": "482814", "tk": "3499", "to": "11398029424.65", "tsq": "962106", "v": "9865605"}

    {"ap": "1487.41", "bp": "1486.95", "bq": "15", "bs": "68", "c": "1490.25", "cng": "-03.30", "e": "nse_cm", "lo": "1481.00", "ltp": "1486.95", "ltq": "54", "ltt": "16/06/2021 11:03:38", "name": "sf", "nc": "-00.2214", "sp": "1487.05", "tbq": "320962", "tk": "1333", "to": "2439462468.34", "tsq": "503241", "v": "1640074"}

    {"ap": "429.50", "bp": "428.50", "bq": "652", "bs": "1879", "c": "429.50", "cng": "-00.95", "e": "nse_cm", "lo": "425.90", "ltp": "428.55", "ltq": "30", "ltt": "16/06/2021 11:03:40", "name": "sf", "nc": "-00.2212", "sp": "428.55", "tbq": "1400134", "tk": "3045", "to": "3736246699.50", "tsq": "2841393", "v": "8699061"}

    {"ap": "1472.36", "bp": "1469.00", "bq": "117", "bs": "151", "c": "1473.90", "cng": "-04.85", "e": "nse_cm", "lo": "1467.50", "ltp": "1469.05", "ltq": "11", "ltt": "16/06/2021 11:03:40", "name": "sf", "nc": "-00.3291", "sp": "1469.05", "tbq": "291278", "tk": "1594", "to": "2326269905.60", "tsq": "459750", "v": "1579960"}


  • Hi @anuragbaheti You can use the websocket now the above mentioned issue is solved.