Welcome Guest Search | Active Topics | Members | Log In | Register

check an IConnection connection state Options
fade
Posted: Tuesday, October 27, 2009 6:40:34 PM
Rank: Member
Groups: Member

Joined: 10/27/2009
Posts: 3
Points: 9
why isn't there a way to check an IConnection state? i see the onClose event, but what if you register for the event after the connection is actually closed? will i miss the disconnection event and have a floating object?

Thanks

Amit
admin
Posted: Thursday, October 29, 2009 1:08:15 PM
Rank: Administration
Groups: Administration

Joined: 2/15/2008
Posts: 130
Points: 835
OnClose event will be fired only after you make any call(read, write) to the connection object.
So you should subscribe to the event before making read, write calls.
fade
Posted: Thursday, October 29, 2009 8:15:28 PM
Rank: Member
Groups: Member

Joined: 10/27/2009
Posts: 3
Points: 9
Thanks,
So, to clarify:
1. when i start a ReadAsync operation and the connection is closed, the ReadFailed is called, in addition to the OnClose event, which one is called first?
2. when the read fails, is it only due to connection failure or other reasons? how do i know if the connection is still alive?
3. Can you give me reference to Error codes received in the 'Failed' callbacks?

Amit.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.6 (NET v2.0) - 11/14/2007
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 0.069 seconds.
10 queries (0.020 seconds, 28.99%).

yaf_pageload: 0.005
yaf_topic_info: 0.001
yaf_forum_list: 0.001
yaf_forum_listpath: 0.001
yaf_forum_listpath: 0.001
yaf_post_list: 0.003
yaf_usergroup_list: 0.004
yaf_usergroup_list: 0.002
yaf_usergroup_list: 0.001
yaf_active_listtopic: 0.001