For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
5 1 1 1

Websocket error while ReceiveAsync() System.AggregateException

I am working on application using websocket to fetch data from ERT cloud.

While receiving data from websocket, I am getting System.AggregateException.

and innerException message "An internal WebSocket error occurred. Please see the innerException, if present, for more details".

I even tried samples provided in named "MarketPriceEdpGwAuthenticationExample". I get similar error also while I run given example also.


Any help would be greatly appreciated


please find attached file containing stacktrace.


stacktrace.txt


refinitiv-realtimetreprdp-apiwebsocketsrrto
stacktrace.txt (9.4 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
20.3k 73 10 20

Hi @cbhavsar

As well as raising the ticket, you should also amend your program to attempt a fresh authenticate,reconnect and login automatically when the websocket is closed off.

The examples we provide are basic ones for demo purposes only and therefore do not include the above type of behaviour - which should be added to production implementations.

Obviously, this does not mean that you won't necessarily lose any updates - but it can potentially avoid manual intervention.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
20.3k 73 10 20

Hi @cbhavsar

Please provide more details on when you see this error so we can assist.

Does it happen every time you run the example?

Are you able to get any data successfully at all?

At what point in the example run process does the error occur? e.g. before or after the GetAuthenticationInfo, before or after the ConnectAsync, before after a ReceiveMessage?

Please provide console output (remove any secure information) also.



icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
5 1 1 1

Hi Umer-

Please find addition details as below.

Does it happen every time you run the example?

>>Nope. I come occasionally like once or twice in hours.

Are you able to get any data successfully at all?

>>Yes, we get data if do not get this exception. if we try to reconnect then it starts working fine

but we lose valuable updates in between disconnect and connect.

At what point in the example run process does the error occur? e.g. before or after the GetAuthenticationInfo, before or after the ConnectAsync, before after a ReceiveMessage?

>>before after a ReceiveMessage?

Please provide console output (remove any secure information) also.

>> I will send console output once I get error next time. I have lost it for last run,

Please see if stack trace helps in the attachments if that helps in the meantime,

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
20.3k 73 10 20

Hi @cbhavsar

I am assuming you are sending Ping / Pong response in a timely manner and refreshing the tokens - which I expect is the case if problem occurs after 1-2 hrs of runtime.

Also, I can see in the stack trace:

Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

Therefore, you should raise a Ticket with the ERT in Cloud team - providing details of times when the exceptions occurred and including the stack trace.

The team has access to the ERTiC systems and can assist you with diagnostics.

Make sure you mention that the problem also occurs with the Refintiv supplied example MarketPriceEdpGwAuthenticationExample.



1588678772388.png (8.1 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
5 1 1 1

Ok. I will raise ticket with support.

Thanks for the help Umer

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
5 1 1 1

Yes, In my application I do reconnect, send login and request items. but I wanted to check if my application is having the issue. I ran sample application and tested and I got same error in sample application as well. so I am not sure what is the reason for this error.



icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

@cbhavsar

Based on the stack trace I am hoping the answer lies with the ERT in Cloud team - hopefully, they will provide some answers...

Hi Umer- Thanks for help.

I need help on one more thing..

data that I receive some times contains ??? chars.

do you how can I fix it to display correct values

Click below to post an Idea Post Idea