API Support Forum
OEC API > API Support > Autoreconnect login problem
Author Topic: Autoreconnect login problem
(3 messages, Page 1 of 1)
Moderators: VPfau
KZetterstrom
Posts: 6
Joined: Jun 22, 2011


Posted: Jul 19, 2011 @ 11:58 PM             Msg. 1 of 3
Hi,

I am having a problem with auto-connect. If I disconnect my computer from the internet, within a few seconds the app (a spin off of the basic api example, with the connect flag set to true to autoconnect) will receive the OnDisconnected(). When I connect my internet connection back up, after about 20 seconds i receive the OnLoginComplete() immediately followed by a OnLoginFailed(), with an OEC.Data.FailReason "Data Error"

What is going wrong?

If I hit the Disconnect button to disconnect, followed by the Connect button (going off the basic api example, again), everything works correctly which leads me to question why the autoconnect will not work?

Kevin Zetterstrom
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Jul 20, 2011 @ 03:08 PM             Msg. 2 of 3
Hello,

you need to add try..catch to event handler Form1.oecClient1_OnLoginComplete(): I see you don't catch an exception related with file I/O inside your application.

Victor Vins
Lead Software Developer
KZetterstrom
Posts: 6
Joined: Jun 22, 2011


Posted: Jul 20, 2011 @ 05:05 PM             Msg. 3 of 3
Thanks Victor, that fixed it.

Kevin Zetterstrom