@@ -75,7 +75,7 @@ public ClientRemoteConnectorInfoManager(RemoteWSFrameworkConnectionInfo info,
75
75
{
76
76
if ( result . IsCompleted )
77
77
{
78
- connections [ ( int ) o ] = result . Result ;
78
+ connections [ ( int ) o ] = result . Result ;
79
79
}
80
80
else if ( result . IsFaulted )
81
81
{
@@ -119,7 +119,8 @@ private sealed class RemoteDelegatingAsyncConnectorInfoManager : DelegatingAsync
119
119
{
120
120
private readonly ClientRemoteConnectorInfoManager _parent ;
121
121
122
- public RemoteDelegatingAsyncConnectorInfoManager ( ClientRemoteConnectorInfoManager parent ) : base ( true )
122
+ public RemoteDelegatingAsyncConnectorInfoManager ( ClientRemoteConnectorInfoManager parent )
123
+ : base ( true )
123
124
{
124
125
_parent = parent ;
125
126
}
@@ -169,13 +170,29 @@ private readonly ConcurrentDictionary<RemoteWSFrameworkConnectionInfo, ClientRem
169
170
registry =
170
171
new ConcurrentDictionary < RemoteWSFrameworkConnectionInfo , ClientRemoteConnectorInfoManager > ( ) ;
171
172
173
+ private readonly Timer _timer ;
174
+
172
175
internal RemoteConnectionInfoManagerFactory (
173
176
IMessageListener < WebSocketConnectionGroup , WebSocketConnectionHolder , RemoteOperationContext >
174
177
messageListener ,
175
178
ConnectionManagerConfig managerConfig )
176
179
{
177
180
this . _messageListener = messageListener ;
178
181
this . managerConfig = managerConfig ;
182
+
183
+
184
+ _timer = new Timer ( state =>
185
+ {
186
+ if ( Running )
187
+ {
188
+ foreach ( var connectionGroup in connectionGroups . Values )
189
+ {
190
+ Trace . TraceInformation ( "Check ConnectionGroup:{0} - operational={1}" , connectionGroup . RemoteSessionId
191
+ , connectionGroup . Operational ) ;
192
+ connectionGroup . CheckIsActive ( ) ;
193
+ }
194
+ }
195
+ } , null , TimeSpan . FromMinutes ( 1 ) , TimeSpan . FromMinutes ( 4 ) ) ;
179
196
}
180
197
181
198
public IRemoteConnectorInfoManager Connect ( RemoteWSFrameworkConnectionInfo info )
@@ -215,6 +232,7 @@ public IRemoteConnectorInfoManager Connect(RemoteWSFrameworkConnectionInfo info)
215
232
216
233
protected internal void doClose ( )
217
234
{
235
+ _timer . Dispose ( ) ;
218
236
foreach ( var clientRemoteConnectorInfoManager in registry . Values )
219
237
{
220
238
clientRemoteConnectorInfoManager . Dispose ( ) ;
@@ -356,7 +374,7 @@ public virtual long HeartbeatInterval
356
374
357
375
#endregion
358
376
359
- #region sd
377
+ #region WebSocketWrapper
360
378
361
379
public class WebSocketWrapper : WebSocketConnectionHolder
362
380
{
@@ -524,15 +542,15 @@ private static void RunInTask(Action action)
524
542
protected override async Task WriteMessageAsync ( byte [ ] entry , WebSocketMessageType messageType )
525
543
{
526
544
var messageBuffer = entry ;
527
- var messagesCount = ( int ) Math . Ceiling ( ( double ) messageBuffer . Length / SendChunkSize ) ;
545
+ var messagesCount = ( int ) Math . Ceiling ( ( double ) messageBuffer . Length / SendChunkSize ) ;
528
546
529
547
for ( var i = 0 ; i < messagesCount ; i ++ )
530
548
{
531
- var offset = ( SendChunkSize * i ) ;
549
+ var offset = ( SendChunkSize * i ) ;
532
550
var count = SendChunkSize ;
533
551
var lastMessage = ( ( i + 1 ) == messagesCount ) ;
534
552
535
- if ( ( count * ( i + 1 ) ) > messageBuffer . Length )
553
+ if ( ( count * ( i + 1 ) ) > messageBuffer . Length )
536
554
{
537
555
count = messageBuffer . Length - offset ;
538
556
}
0 commit comments