API C# 3.17: StopAsync do not Stop QuerySubscription

Discussion about recent product features & solutions!
Search

Post Reply
2 posts • Page 1 of 1
Victor.Ermakov
Posts: 17
Joined: Fri Oct 20, 2017 6:50 am

API C# 3.17: StopAsync do not Stop QuerySubscription

Post by Victor.Ermakov » Fri Oct 09, 2020 12:28 pm

I want to change Query string:

Code: Select all

                        (new Action(async () => { 
                            await QuerySubscription.StopAsync();//Wait for end QuerySubscription
                            QuerySubscription.SetQuery(OAQuery);//!!!!ERROR System.InvalidOperationException: "Setting sql query is only allowed in status 'Stopped'. Current status is 'Stopping'."
                            await QuerySubscription.StartAsync();
                        }))();
i do synchronous stop->change query->start..

on "change query" generates an Error: System.InvalidOperationException: "Setting sql query is only allowed in status 'Stopped'. Current status is 'Stopping'."

Victor.Ermakov
Posts: 17
Joined: Fri Oct 20, 2017 6:50 am

Re: API C# 3.17: StopAsync do not Stop QuerySubscription

Post by Victor.Ermakov » Thu Oct 15, 2020 5:33 am

API do not receive a connecction message from Server

WCCILevent (0), 2020.10.15 10:09:22.786, SYS, SEVERE, 39, Connection lost, Send buffer limit exceeded, closing connection to (SYS: 1 Api -num 1 CONN: 1) @ WIN-36TE9LFF0BQ, [PeerItcIOHandler::sendCall]
WCCOApostgree(1), 2020.10.15 10:09:22.787, SYS, WARNING, 39, Connection lost, MAN: (SYS: 1 Event -num 0 CONN: 1), Connection reset by peer (10054)
WCCILevent (0), 2020.10.15 10:09:22.822, SYS, WARNING, 54, Unexpected state, Send buffer limit exceeded for connection to (SYS: 1 Data -num 0 CONN: 1) @ WIN-36TE9LFF0BQ, [PeerItcIOHandler::sendCall]
WCCILevent (0), 2020.10.15 10:09:22.826, SYS, WARNING, 54, Unexpected state, Send buffer limit exceeded for connection to (SYS: 1 Data -num 120 CONN: 1) @ WIN-36TE9LFF0BQ, [PeerItcIOHandler::sendCall]
WCCOAnextgenarch(118), 2020.10.15 10:09:31.168, IMPL, SEVERE, 0, , Error while writing values to influx: unable to parse 'ALERT,name=System1:PostgresPro=Test.TestFloat,variabletype=PostgresPro,_dpid_dp=000001503,_dpid_el=000000005,detail=2 alarmvalue_type=3i,alarmvalue_float=2.000000,_abbr_0="aA",_ack_state=0i,_ack_time=0,_ack_type=3i,_ack_user=0i,_ackable=true,_alert_color="advanceAlarmCamUna",_alert_font_style="",_alert_fore_color="",_alert_id="",_class="System1:advanceAlarm.",_comment="",_dest=2i,_dest_text_0="",_direction=true,_inact_ack=false,_panel="",_partn_idx=0i,_partner=0,_prior=20i,_single_ack=false,_state=34429i,_system_time=1602131147086000000,_text_0="",_value_status64=-9007199254737846015i,_visible=true 1602131147085000000': invalid tag format (from _NGA_B_InfluxDB)
WCCOApostgree(1), 2020.10.15 10:09:32.919, SYS, INFO, 4, Connected to (SYS: 1 Event -num 0 CONN: 1) @ WIN-36TE9LFF0BQ (::1)


when a message specified by the log is received, the ConnectionStateChanged event Handler is not called::

Code: Select all

            // Create Manager object
            OaManager myManager = OaSdk.CreateManager();

            // Initialize Manager Configuration
            myManager.Init(ManagerSettings.DefaultApiSettings, args);
            
            //!!!!!!!!!!!!!!
            myManager.ConnectionStateChanged += (vcsender, vce) => {//!!!!!!!!!!!!!!!!!!!!!!!!!

                Console.WriteLine("myManager.ConnectionStateChanged:" + vce.OldState.ToString() + "/" + vce.NewState.ToString());
            };[

Class OaDpQuerySubscription has a not public Property Status. The Status go to state "Stopped" on disconnection of Server. How to I check the Status before calling a StopAsync?

Post Reply
2 posts • Page 1 of 1