发送端,不用绑定端口

This commit is contained in:
祝发冬
2023-08-27 22:22:56 +08:00
parent 6075d88f59
commit 8ec73c1dcb
2 changed files with 6 additions and 4 deletions
+4 -2
View File
@@ -138,8 +138,10 @@
_clientUdpSocket = [[GCDAsyncUdpSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()];
[_clientUdpSocket enableBroadcast:YES error:&error];
}
if (![_clientUdpSocket bindToPort:0 error:&error])
BOOL bind = YES;
// bind =[_clientUdpSocket bindToPort:0 error:&error]
if (!bind)
{
}