socket配网优化

This commit is contained in:
祝发冬 2022-06-25 22:55:29 +08:00
parent 5041412a54
commit 26a52f68df
1 changed files with 3 additions and 2 deletions

View File

@ -31,12 +31,12 @@
@end
static IFishHotpotUDPHelper *sharedInstace = nil;
@implementation IFishHotpotUDPHelper
+ (IFishHotpotUDPHelper *)sharedInstance{
static IFishHotpotUDPHelper *sharedInstace = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedInstace = [[self alloc] init];
@ -188,6 +188,7 @@
-(void)onUdpSocketDidClose:(AsyncUdpSocket *)sock{
[self postmsg:@"连接关闭"];
self.bindok=NO;
if (self.closeBlock) {
self.closeBlock();
}