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(); }