API Support Forum
OEC API > API Support > Re-subscribe After Disconnect.
Author Topic: Re-subscribe After Disconnect.
(4 messages, Page 1 of 1)
Moderators: VPfau
eo707
Posts: 68
Joined: Nov 08, 2011


Posted: Jan 19, 2016 @ 06:54 AM             Msg. 1 of 4
Hey,
I do connect, then on LoginComplete, ask for:OECClient.Global.RequestContracts(baseContract).
Then on: OnContractsChanged i call Subscribe(Contract)...
All of it go automatically.
Then I am connected, and prices streaming in.


The Error Starts on:
I call Disconnect();

When I attempt to repeat the above process, it won't subscribe.
Only when I restart the program, I get it like before.

Do I miss anything, or you have a bug?

Thanks
CMicciche902
Posts: 367
Joined:


Posted: Jan 19, 2016 @ 10:22 AM             Msg. 2 of 4
Do you see same behavior with OEC Sample apps? I am not replicating an issue on my end.

We have several external Developers and vendors using our API. This issue has not been reported by other users.

Chris M
NShine
Posts: 36
Joined:


Posted: Jan 19, 2016 @ 10:39 AM             Msg. 3 of 4
As with Chris, I am not seeing this issue. You are correct that a resubscribe is needed after disconnecting, but when I do the steps you laid out above, I have no issues.
eo707
Posts: 68
Joined: Nov 08, 2011


Posted: Jan 19, 2016 @ 03:50 PM             Msg. 4 of 4
My apology..
This is not consistent.
Now I just tried, and I click (my app) connect, then I get it as connected, and since on login, I request contract, and then on contract, I request subscription automatically...
So, only connect will do the subscription as well.

Then I click Disconnect, and I got Disconnected, and Unsubscribed....Then, only Connect will reutrn back the subscription and OnPriceChange where I trigger my logic..

Seems to be all good..
Sorry..
Maybe before before Market Time, it behave different.