@@ -126,10 +126,15 @@ export class WingInstance extends InstanceBase<WingConfig> implements InstanceBa
126126 this . connection . open ( '0.0.0.0' , 0 , this . config . host ! , 2223 )
127127 this . connection . setSubscriptionInterval ( this . config . subscriptionInterval ?? 9000 )
128128 this . connection . startSubscription ( )
129+ this . updateStatus ( InstanceStatus . Connecting , 'waiting for response from console...' )
129130
130131 this . connection ?. on ( 'ready' , ( ) => {
131- this . updateStatus ( InstanceStatus . Connecting , 'waiting for response from console...' )
132- void this . connection ?. sendCommand ( '/*' , undefined , undefined , true ) // send something to trigger response from console
132+ this . updateStatus ( InstanceStatus . Ok )
133+ this . stateHandler ?. state ?. requestNames ( this )
134+ if ( this . config . prefetchVariablesOnStartup ) {
135+ this . stateHandler ?. state ?. requestAllVariables ( this )
136+ }
137+ this . stateHandler ?. requestUpdate ( )
133138 } )
134139
135140 this . connection ?. on ( 'error' , ( err : Error ) => {
@@ -151,11 +156,6 @@ export class WingInstance extends InstanceBase<WingConfig> implements InstanceBa
151156 this . logger ?. info ( 'OSC connection established' )
152157
153158 this . feedbackHandler ?. startPolling ( )
154- this . stateHandler ?. state ?. requestNames ( this )
155- if ( this . config . prefetchVariablesOnStartup ) {
156- this . stateHandler ?. state ?. requestAllVariables ( this )
157- }
158- this . stateHandler ?. requestUpdate ( )
159159 }
160160 this . feedbackHandler ?. clearPollTimeout ( )
161161 this . stateHandler ?. processMessage ( msg )
0 commit comments