iOS16使用单播

This commit is contained in:
祝发冬 2023-08-31 23:34:35 +08:00
parent f38f9effaa
commit b6b5f90962
2 changed files with 10 additions and 3 deletions

View File

@ -16101,7 +16101,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 9;
DEVELOPMENT_TEAM = WFX8GD5HFX;
ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES;
@ -16221,7 +16221,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 9;
DEVELOPMENT_TEAM = WFX8GD5HFX;
ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES;

View File

@ -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];