Re: [Firebird-net-provider] [FB-Tracker] Reopened: (DNET-171) Implementing IDisposable interface and possibility to stop Socket operations in FbRemoteEvent
On Tue, Mar 24, 2009 at 22:21, Charlie Xiong wrote: > Hopefully I didn't miss any news on this but, I was wondering if there > has been any improvements toward .Net's event posting and > listening/receiving mechanism. Yes, a lot. Thread synchronization, proper ending of connection, fixed port reading, IP reading if server behind NAT just couple of thinks I recall right now. > Specifically the desire of registering multiple events per connection. > i.e. > EventComp = new FbRemoteEvent(FireBirdConnection, new string[] { > "event1","event2","event3","eventN" }); That's working. Don't forgot to start listening for events calling QueueEvents. -- Jiri {x2} Cincura (CTO x2develop.com) http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] [FB-Tracker] Reopened: (DNET-171) Implementing IDisposable interface and possibility to stop Socket operations in FbRemoteEvent
Hello list, Hopefully I didn't miss any news on this but, I was wondering if there has been any improvements toward .Net's event posting and listening/receiving mechanism. Specifically the desire of registering multiple events per connection. i.e. EventComp = new FbRemoteEvent(FireBirdConnection, new string[] { "event1","event2","event3","eventN" }); * Currently, under 2.0.1.0 client - this implementation fails to receive any events. Thanks, Charlie -Original Message- From: Jiri Cincura (JIRA) [mailto:trac...@firebirdsql.org] Sent: Wednesday, January 21, 2009 11:20 AM To: firebird-net-provider@lists.sourceforge.net Subject: [Firebird-net-provider] [FB-Tracker] Reopened: (DNET-171) Implementing IDisposable interface and possibility to stop Socket operations in FbRemoteEvent [ http://tracker.firebirdsql.org/browse/DNET-171?page=com.atlassian.jira.p lugin.system.issuetabpanels:all-tabpanel ] Jiri Cincura reopened DNET-171: --- Opened for better implementation. Check next comment. > Implementing IDisposable interface and possibility to stop Socket > operations in FbRemoteEvent > -- > > > Key: DNET-171 > URL: http://tracker.firebirdsql.org/browse/DNET-171 > Project: .NET Data provider > Issue Type: New Feature > Components: ADO.NET Provider >Affects Versions: 2.5.0 Alpha 2 >Reporter: Pavel >Assignee: Jiri Cincura > Fix For: 2.5.0 Beta 1, 2.5.0 Beta 2, 2.5.0 > > > is it possible to implement an IDisposable pattern for FbRemoteEvent? There are a lot of small problems now. For instance: > if you pass an connection object to the FbRemoteEvent constructor > there are two possibilities > 1) you are as owner responsible for destroying this connection object > - doesn't work for now, if you dispose connection, there is a socket > exception, cause RemoteEvent still tries to read from already disposed > stream > 2) FbRemoteEvent should destroy it - there is no place in code, where > FbRemoteEvent would manage connection dispose. As i understand, you cannot stop it from listening at all. the thread, that is reading responses from server is declared "background" and reads until owning window is destroyed (and causes bunch of ThreadAbortedException's) to understand the problem, consider this test case > FbConnection conn1 = new FbConnection(""); > conn1.Open(); > revent = new FbRemoteEvent(conn1, new[] { "event" }); > revent.RemoteEventCounts += revent_RemoteEventCounts; > revent.QueueEvents(); revent.CancelEvents(); revent.RemoteEventCounts > -= revent_RemoteEventCounts; revent.Connection = null; //this will > cause an socket exception conn1.Dispose(); Is there any possibility to > implement some Stop method (that causes stoppage of all socket/thread stuff) - in my opinion - CancelEvents might do this work. And it would be nice to know, that the same functionality (and also dispose of connection) would be done in Dispose method. We can still dispose connection on our own, but only if we can stop socket listening (and this must be clearly stated in docu). -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
[Firebird-net-provider] [FB-Tracker] Reopened: (DNET-171) Implementing IDisposable interface and possibility to stop Socket operations in FbRemoteEvent
[ http://tracker.firebirdsql.org/browse/DNET-171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jiri Cincura reopened DNET-171: --- Opened for better implementation. Check next comment. > Implementing IDisposable interface and possibility to stop Socket operations > in FbRemoteEvent > -- > > Key: DNET-171 > URL: http://tracker.firebirdsql.org/browse/DNET-171 > Project: .NET Data provider > Issue Type: New Feature > Components: ADO.NET Provider >Affects Versions: 2.5.0 Alpha 2 >Reporter: Pavel >Assignee: Jiri Cincura > Fix For: 2.5.0 Beta 1, 2.5.0 Beta 2, 2.5.0 > > > is it possible to implement an IDisposable pattern for FbRemoteEvent? There > are a lot of small problems now. For instance: > if you pass an connection object to the FbRemoteEvent constructor there are > two possibilities > 1) you are as owner responsible for destroying this connection object - > doesn't work for now, if you dispose connection, there is a socket exception, > cause RemoteEvent still tries to read from already disposed stream > 2) FbRemoteEvent should destroy it - there is no place in code, where > FbRemoteEvent would manage connection dispose. As i understand, you cannot > stop it from listening at all. the thread, that is reading responses from > server is declared "background" and reads until owning window is destroyed > (and causes bunch of ThreadAbortedException's) > to understand the problem, consider this test case > FbConnection conn1 = new FbConnection(""); > conn1.Open(); > revent = new FbRemoteEvent(conn1, new[] { "event" }); > revent.RemoteEventCounts += revent_RemoteEventCounts; > revent.QueueEvents(); > revent.CancelEvents(); > revent.RemoteEventCounts -= revent_RemoteEventCounts; > revent.Connection = null; > //this will cause an socket exception > conn1.Dispose(); > Is there any possibility to implement some Stop method (that causes stoppage > of all socket/thread stuff) - in my opinion - CancelEvents might do this > work. And it would be nice to know, that the same functionality (and also > dispose of connection) would be done in Dispose method. We can still dispose > connection on our own, but only if we can stop socket listening (and this > must be clearly stated in docu). -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider