From 26a52f68df1a2fddf875ad9c5011125d15fa4573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9D=E5=8F=91=E5=86=AC?= Date: Sat, 25 Jun 2022 22:55:29 +0800 Subject: [PATCH] =?UTF-8?q?socket=E9=85=8D=E7=BD=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.m b/Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.m index 6851c6f..dd174d5 100644 --- a/Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.m +++ b/Ifish/controllers/leftcontrollers/IFishHotpotUDPHelper.m @@ -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(); }