Revision: 29713
http://sourceforge.net/p/bibdesk/svn/29713
Author: hofman
Date: 2025-10-12 16:11:13 +0000 (Sun, 12 Oct 2025)
Log Message:
-----------
make sure number of clients is updated
Modified Paths:
--------------
trunk/bibdesk/BDSKSharingServer.m
Modified: trunk/bibdesk/BDSKSharingServer.m
===================================================================
--- trunk/bibdesk/BDSKSharingServer.m 2025-10-12 15:47:40 UTC (rev 29712)
+++ trunk/bibdesk/BDSKSharingServer.m 2025-10-12 16:11:13 UTC (rev 29713)
@@ -584,12 +584,6 @@
return self;
}
-- (void)setNumberOfConnections:(NSUInteger)count {
- dispatch_async(dispatch_get_main_queue(), ^{
- [sharingServer setNumberOfConnections:count];
- });
-}
-
#pragma mark Main Thread
- (void)stop {
@@ -601,6 +595,13 @@
#pragma mark Local Thread
+- (void)updateNumberOfConnections {
+ NSUInteger count = [registeredClients count];
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [sharingServer setNumberOfConnections:count];
+ });
+}
+
#pragma mark | Async Object
- (void)didSetup
@@ -634,8 +635,6 @@
sharingName = name;
dispatch_async(dispatch_get_main_queue(), ^{
[sharingServer asyncServer:self didSetupWithSharingName:name
tryCount:tryCount port:port];
- // this is no longer needed
- sharingServer = nil;
});
break;
}
@@ -649,8 +648,6 @@
[receivePort invalidate];
dispatch_async(dispatch_get_main_queue(), ^{
[sharingServer asyncServerDidFailToSetup:self];
- // this is no longer needed
- sharingServer = nil;
});
}
}
@@ -665,7 +662,7 @@
[connectedClients makeObjectsPerformSelector:@selector(invalidate)];
[connectedClients removeAllObjects];
[registeredClients removeAllObjects];
- [self setNumberOfConnections:0];
+ [self updateNumberOfConnections];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@@ -751,7 +748,7 @@
[clientObject setProtocolForProxy:@protocol(BDSKSharingClient)];
[client setProxy:clientObject];
[registeredClients setObject:client forKey:identifier];
- [self setNumberOfConnections:[registeredClients count]];
+ [self updateNumberOfConnections];
}
}
@@ -776,7 +773,7 @@
[connectedClients removeObject:client];
[[client connection] invalidate];
}
- [self setNumberOfConnections:[registeredClients count]];
+ [self updateNumberOfConnections];
}
- (void)notifyClientsOfChange;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit