iOS16使用单播
This commit is contained in:
@@ -103,8 +103,15 @@
|
||||
for (int j = 0; j < length; j++) {
|
||||
[mData appendBytes:&value length:1];
|
||||
}
|
||||
NSString*host = kAirKiss_Host;
|
||||
if (@available(iOS 16.0, *))
|
||||
{
|
||||
NSArray *arr = [_localIP componentsSeparatedByString:@"."];
|
||||
host=[NSString stringWithFormat:@"%@.%@.%@.255",arr[0], arr[1], arr[2]];
|
||||
}
|
||||
|
||||
[_clientUdpSocket sendData:mData
|
||||
toHost:kAirKiss_Host
|
||||
toHost:host
|
||||
port:kAirKiss_Port
|
||||
withTimeout:-1
|
||||
tag:_tag];
|
||||
|
||||
Reference in New Issue
Block a user