Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Network] Add support for Xcode 14 beta 6. #15841

Merged
merged 10 commits into from
Sep 8, 2022
7 changes: 7 additions & 0 deletions src/Network/NWEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,11 @@ public enum NWParametersAttribution {
Developer = 1,
User = 2,
}

[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
public enum NWQuicStreamType {
Unknown = 0,
Bidirectional = 1,
Unidirectional = 2,
}
}
2 changes: 0 additions & 2 deletions src/Network/NWProtocolFramerOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ public void SetValue<T> (string key, T? value) where T : NSObject

public T? GetValue<T> (string key) where T : NSObject {
var value = nw_framer_options_copy_object_value (GetCheckedHandle (), key);
if (value == IntPtr.Zero)
return null;
return Runtime.GetNSObject<T> (value, owns: true);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Network/NWProtocolQuicOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public bool StreamIsDatagram {
[Watch (9,0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern byte nw_quic_get_stream_type (OS_nw_protocol_metadata stream_metadata);
static extern NWQuicStreamType nw_quic_get_stream_type (OS_nw_protocol_metadata stream_metadata);
Copy link
Member

@rolfbjarne rolfbjarne Sep 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The native function still returns a byte, so it should be declared as such.


#if NET
[SupportedOSPlatform ("tvos16.0")]
Expand All @@ -289,7 +289,7 @@ public bool StreamIsDatagram {
[iOS (16,0)]
[Watch (9,0)]
#endif
public byte StreamType => nw_quic_get_stream_type (GetCheckedHandle ());
public NWQuicStreamType StreamType => nw_quic_get_stream_type (GetCheckedHandle ());

}
}