API Support Forum
OEC API > API Support > What can be the reason for continues disconnecting?
Author Topic: What can be the reason for continues disconnecting?
(4 messages, Page 1 of 1)
Moderators: VPfau
eo707
Posts: 68
Joined: Nov 08, 2011


Posted: Dec 19, 2011 @ 03:59 PM             Msg. 1 of 4
I am subscribed for a contract and the feed is constantly getting disconnected..

What can be the reason for that.

I have the auto connect set to true.
When it is getting disconnecting, I have a timer that will connect again. but still it is constantly getting disconnected.

I am connected to api, and not to sim... will that be a different?
Should I setup a demo account to get real feed (onPriceChanged)

In addition, large percentage of the current price LastDateTime, is NULL, and the LastPrice is 0....

Please elaborate.

Thank you.
Edited by eo707 on Dec 19, 2011 at 16:01:21
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Dec 19, 2011 @ 04:09 PM             Msg. 2 of 4
Our server disconnects your connection, because your application raises a lot of exceptions. Please add an exception handler to your event handler OnPriceChanged.

Victor Vins
Lead Software Developer
eo707
Posts: 68
Joined: Nov 08, 2011


Posted: Dec 20, 2011 @ 01:27 AM             Msg. 3 of 4
Victor,
It is very nice to see that you have the ability to detect to that level.

I looked at my code. I believe that what causing the error is the fact the the LastDateTime came as NULL.

I wrote it in my first post. In addition I can see the LastPrice is 0.

Can you comment on that?

and Please tell me in addition that when I record an event and I wish to get the entire data, there is a different if I am connected to the api or to the sim? And I what stage I will have to try my app on the demo?

Is there a different if I run my code against api account or demo account?

Thank you.
Edited by eo707 on Dec 20, 2011 at 01:29:19
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Dec 20, 2011 @ 09:04 AM             Msg. 4 of 4
Maybe I missed something, but I don't think that this value type property can be NULL: http://www.openecry.com/api/api/OEC.API.Price.LastDateTime.html

To check what fields have a value you need to check this property http://www.openecry.com/api/api/OEC.API.Price.Fields.html. LastPrice can be undefined in some situations.

API and demo environments have the same prices and simulation engine.

You need to contact Customer Service about running your code against demo environment.

Victor Vins
Lead Software Developer