Websocket C# client Exception "An exception has occurred while receiving. (1006 Abnormal)"

Hi Team
We are observing some exception in websocket client application (Error "An exception has occurred while receiving. (1006 Abnormal)")
In order to recover from this issue , we need to bounce the application.
Application logs
2021-09-14 10:24:21,722 [121] INFO : MarketDataLog - WebSocket (ny1-cld-ws-ct.am.hedani.net) was closed: An exception has occurred while receiving. (1006 Abnormal)
2021-09-14 10:24:21,722 [121] INFO : MarketDataLog - MarketDataConnectionStatusChange ConnectionDown: Connection down
2021-09-14 10:24:21,723 [335] INFO : MarketDataLog - Connecting to WebSocket ws://ny1-cld-ws-ct.am.hedani.net:15000/WebSocket
2021-09-14 10:24:21,729 [335] INFO : MarketDataLog - Connected to ny1-cld-ws-ct.am.hedani.net
2021-09-14 10:24:21,729 [335] INFO : MarketDataLog - MarketDataConnectionStatusChange ConnectionUp: Connection up. Host=ny1-cld-ws-ct.am.hedani.net Position=169.254.1.222 User=559_mavenserver_0 Appid=559
2021-09-14 10:24:21,729 [335] INFO : MarketDataLog - Attempting login for 559_mavenserver_0 [appid = 559]
2021-09-14 10:24:21,735 [121] INFO : MarketDataLog - Reconnected to new WebSocket so redoing all subscriptions
2021-09-14 10:24:34,217 [181] INFO : MarketDataLog - MarketDataAdapter.Unsubscribe PI_L1_INT|CPSL3|FieldList|0
2021-09-14 10:24:34,334 [211] INFO : MarketDataLog - WebSocket (ny1-cld-ws-ct.am.hedani.net) was closed: An exception has occurred while receiving. (1006 Abnormal)
2021-09-14 10:24:34,335 [211] INFO : MarketDataLog - MarketDataConnectionStatusChange ConnectionDown: Connection down
2021-09-14 10:24:34,335 [24] INFO : Gcl.DataSources.Triarch.TriarchDataSource - Market data connection is down
2021-09-14 10:24:34,335 [152] INFO : MarketDataLog - Connecting to WebSocket ws://ny1-cld-ws-ct.am.hedani.net:15000/WebSocket
2021-09-14 10:24:34,342 [295] INFO : MarketDataLog - Unsubscribing 37139 PI_L1_INT|SITM.O|FieldList|0
2021-09-14 10:24:34,342 [295] ERROR: MarketDataLog - Received Error: An error has occurred in sending data.
2021-09-14 10:24:34,342 [121] INFO : MarketDataLog - WebSocket (ny1-cld-ws-ct.am.hedani.net) was closed: An exception has occurred while receiving. (1006 Abnormal)
2021-09-14 10:24:34,342 [121] INFO : MarketDataLog - MarketDataConnectionStatusChange ConnectionDown: Connection down
2021-09-14 10:24:34,342 [121] INFO : MarketDataLog - Connecting to WebSocket ws://ny2-cld-ws-ct.am.hedani.net:15000/WebSocket
2021-09-14 10:24:34,338 [152] INFO : MarketDataLog - Connected to ny1-cld-ws-ct.am.hedani.net
2021-09-14 10:24:34,342 [152] INFO : MarketDataLog - MarketDataConnectionStatusChange ConnectionUp: Connection up. Host=ny1-cld-ws-ct.am.hedani.net Position=169.254.1.222 User=559_mavenserver_0 Appid=559
2021-09-14 10:24:34,342 [152] INFO : MarketDataLog - Attempting login for 559_mavenserver_0 [appid = 559]
2021-09-14 10:24:34,342 [152] ERROR: MarketDataLog - Received Error: An error has occurred in sending data.
2021-09-14 10:24:34,353 [24] INFO : Gcl.DataSources.Triarch.TriarchDataSource - Sending stale message for PI_L1_INT CLLDY
2021-09-14 10:24:34,353 [24] INFO : Gcl.DataSources.Triarch.TriarchDataSource - Sending stale message for PI_L1_INT SAWAD/F
2021-09-14 10:24:34,353 [24] INFO : Gcl.DataSources.Triarch.TriarchDataSource - Sending stale message for PI_L1_INT TGNA
2021-09-14 10:24:34,353 [181] INFO : MarketDataLog - WebSocket (ny2-cld-ws-ct.am.hedani.net) was closed: An exception has occurred while receiving. (1006 Abnormal)
2021-09-14 10:24:34,353 [181] INFO : MarketDataLog - MarketDataConnectionStatusChange ConnectionDown: Connection down
2021-09-14 10:24:34,353 [181] ERROR: MarketDataLog - Unable to connect. No more hosts to try
ADS server logs for the same client for that Day
<uslp9019593.1.ads: Warning: Tue Sep 14 15:28:31.424217 2021> Output threshold OK for "559_mavenserver_0" at position "169.254.1.222" on host "" using application "559" on channel 54. Resuming normal operation.<END>
<uslp9019593.1.ads: Warning: Tue Sep 14 15:28:30.987627 2021> Output threshold breached for "559_mavenserver_0" at position "169.254.1.222" on host "" using application "559" on channel 54.<END>
<uslp9019594.1.ads: Warning: Tue Sep 14 10:24:28.680732 2021> Output threshold breached for "559_mavenserver_0" at position "169.254.1.222" on host "" using application "559" on channel 53.<END>
<uslp9019593.1.ads: Warning: Tue Sep 14 10:06:31.477451 2021> Output threshold breached for "559_mavenserver_0" at position "169.254.1.222" on host "" using application "559" on channel 49.<END>
<uslp9019593.1.ads: Warning: Tue Sep 14 09:46:15.228024 2021> Output threshold OK for "559_mavenserver_0" at position "169.254.1.222" on host "" using application "559" on channel 49. Resuming normal operation.<END>
<uslp9019593.1.ads: Warning: Tue Sep 14 09:46:15.124027 2021> Output threshold breached for "559_mavenserver_0" at position "169.254.1.222" on host "" using application "559" on channel 49.<END>
Our observation
It look like when the first time this error happened @10:24:21 , there were no buffer overflow at ADS
2021-09-14 10:24:21,722 [121] INFO : MarketDataLog - WebSocket (ny1-cld-ws-ct.am.hedani.net) was closed: An exception has occurred while receiving. (1006 Abnormal)
Later on application try to resubscribe all the instrument.
2021-09-14 10:24:21,735 [121] INFO : MarketDataLog - Reconnected to new WebSocket so redoing all subscriptions
Then I can see buffer overflow message at ADS side @10:24:28
<uslp9019594.1.ads: Warning: Tue Sep 14 10:24:28.680732 2021> Output threshold breached for "559_mavenserver_0" at position "169.254.1.222" on host "" using application "559" on channel 53.<END>
Wondering what could be reason for this error at first time ?
Best Answer
-
I got the same error 1006 when I killed the ADS process.
Received Log Event (Level: Fatal): WebSocketSharp.WebSocketException: The header of a frame cannot be read from the stream.
at WebSocketSharp.WebSocketFrame.processHeader(Byte[] header)
at WebSocketSharp.WebSocketFrame.<>c__DisplayClassa.<readHeaderAsync>b__9(Byte[] bytes)
at WebSocketSharp.Ext.<>c__DisplayClass9.<ReadBytesAsync>b__8(IAsyncResult ar)
WebSocket was closed: 1006, An exception has occurred while receiving., WebSocketSharp.CloseEventArgsAccording to the WebSocket protocol, it indicates that the connection was closed abnormally.
1006 is a reserved value and MUST NOT be set as a status code in a
Close control frame by an endpoint. It is designated for use in
applications expecting a status code to indicate that the
connection was closed abnormally, e.g., without sending or
receiving a Close control frame.If the ADS didn't close the connection, it could be a network issue.
You may check if there is any server, such as a firewall, used between the application and ADS.
You can also run the packet analyzer tools, such as Wireshark, or TCPDump to capture network activities. Then, we can analyze the network activities to verify which side causes the disconnection.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 651 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛