@@ -106,7 +106,7 @@ public Task DisposeAsync()
106
106
private Task Unregister ( long registrationId )
107
107
{
108
108
UnregisterRequest unregisterRequest =
109
- new UnregisterRequest ( mFormatter ) ;
109
+ new UnregisterRequest ( mFormatter , registrationId ) ;
110
110
111
111
long requestId = mPendingUnregistrations . Add ( unregisterRequest ) ;
112
112
@@ -119,17 +119,18 @@ private Task Unregister(long registrationId)
119
119
120
120
public void Unregistered ( long requestId )
121
121
{
122
-
123
122
if ( mPendingUnregistrations . TryRemove ( requestId , out UnregisterRequest unregisterRequest ) )
124
123
{
125
- mRegistrations . TryRemove ( requestId , out IWampRpcOperation operation ) ;
124
+ long registrationId = unregisterRequest . RegistrationId ;
125
+
126
+ mRegistrations . TryRemove ( registrationId , out IWampRpcOperation operation ) ;
126
127
127
128
lock ( mLock )
128
129
{
129
130
130
- if ( mRegistrationsToInvocations . TryGetValue ( requestId , out SwapCollection < long > invocationsToRemove ) )
131
+ if ( mRegistrationsToInvocations . TryGetValue ( registrationId , out SwapCollection < long > invocationsToRemove ) )
131
132
{
132
- mRegistrationsToInvocations . Remove ( requestId ) ;
133
+ mRegistrationsToInvocations . Remove ( registrationId ) ;
133
134
134
135
foreach ( long invocationId in invocationsToRemove )
135
136
{
@@ -296,8 +297,11 @@ public RegisterRequest(IWampRpcOperation operation, IWampFormatter<TMessage> for
296
297
297
298
private class UnregisterRequest : WampPendingRequest < TMessage >
298
299
{
299
- public UnregisterRequest ( IWampFormatter < TMessage > formatter ) : base ( formatter )
300
+ public long RegistrationId { get ; }
301
+
302
+ public UnregisterRequest ( IWampFormatter < TMessage > formatter , long registrationId ) : base ( formatter )
300
303
{
304
+ RegistrationId = registrationId ;
301
305
}
302
306
}
303
307
0 commit comments