[autoformat] Add the Network, NetworkExtension and NotificationCenter frameworks. (#16795)

This commit is contained in:
Rolf Bjarne Kvinge 2022-11-17 23:12:32 +01:00 коммит произвёл GitHub
Родитель 5e010e6700
Коммит 2f538ba790
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
50 изменённых файлов: 1126 добавлений и 1101 удалений

Просмотреть файл

@ -14,9 +14,9 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using nw_advertise_descriptor_t=System.IntPtr;
using OS_nw_advertise_descriptor=System.IntPtr;
using OS_nw_txt_record=System.IntPtr;
using nw_advertise_descriptor_t = System.IntPtr;
using OS_nw_advertise_descriptor = System.IntPtr;
using OS_nw_txt_record = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -29,10 +29,10 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWAdvertiseDescriptor : NativeObject {
[Preserve (Conditional = true)]
@ -49,10 +49,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_advertise_descriptor nw_advertise_descriptor_create_application_service (string application_service_name);
@ -63,12 +63,12 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
public NWAdvertiseDescriptor (string applicationServiceName) : base (nw_advertise_descriptor_create_application_service (applicationServiceName), true) {}
public NWAdvertiseDescriptor (string applicationServiceName) : base (nw_advertise_descriptor_create_application_service (applicationServiceName), true) { }
#if NET
[SupportedOSPlatform ("tvos16.0")]
@ -76,10 +76,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern IntPtr nw_advertise_descriptor_get_application_service_name (OS_nw_advertise_descriptor advertise_descriptor);
@ -90,10 +90,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
public string? ApplicationServiceName {
get {
@ -148,9 +148,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_txt_record nw_advertise_descriptor_copy_txt_record_object (OS_nw_advertise_descriptor advertise_descriptor);
@ -161,9 +161,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern void nw_advertise_descriptor_set_txt_record_object (OS_nw_advertise_descriptor advertise_descriptor, OS_nw_txt_record txt_record);
@ -174,9 +174,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
public NWTxtRecord TxtRecord {
get => new NWTxtRecord (nw_advertise_descriptor_copy_txt_record_object (GetCheckedHandle ()), owns: true);

Просмотреть файл

@ -15,9 +15,9 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_browse_result=System.IntPtr;
using OS_nw_endpoint=System.IntPtr;
using OS_nw_txt_record=System.IntPtr;
using OS_nw_browse_result = System.IntPtr;
using OS_nw_endpoint = System.IntPtr;
using OS_nw_txt_record = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -31,15 +31,15 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[Watch (6,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
[Watch (6, 0)]
#endif
public class NWBrowseResult : NativeObject {
[Preserve (Conditional = true)]
internal NWBrowseResult (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWBrowseResult (NativeHandle handle, bool owns) : base (handle, owns) { }
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_endpoint nw_browse_result_copy_endpoint (OS_nw_browse_result result);

Просмотреть файл

@ -16,10 +16,10 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_browser=System.IntPtr;
using OS_nw_browse_descriptor=System.IntPtr;
using OS_nw_parameters=System.IntPtr;
using dispatch_queue_t =System.IntPtr;
using OS_nw_browser = System.IntPtr;
using OS_nw_browse_descriptor = System.IntPtr;
using OS_nw_parameters = System.IntPtr;
using dispatch_queue_t = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -37,10 +37,10 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[Watch (6,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
[Watch (6, 0)]
#endif
public class NWBrowser : NativeObject {
@ -66,7 +66,7 @@ namespace Network {
SetChangesHandler (InternalChangesHandler);
}
public NWBrowser (NWBrowserDescriptor descriptor) : this (descriptor, null) {}
public NWBrowser (NWBrowserDescriptor descriptor) : this (descriptor, null) { }
[DllImport (Constants.NetworkLibrary)]
static extern void nw_browser_set_queue (OS_nw_browser browser, dispatch_queue_t queue);
@ -129,7 +129,7 @@ namespace Network {
=> new NWParameters (nw_browser_copy_parameters (GetCheckedHandle ()), owns: true);
[DllImport (Constants.NetworkLibrary)]
unsafe static extern void nw_browser_set_browse_results_changed_handler (OS_nw_browser browser, void *handler);
unsafe static extern void nw_browser_set_browse_results_changed_handler (OS_nw_browser browser, void* handler);
delegate void nw_browser_browse_results_changed_handler_t (IntPtr block, IntPtr oldResult, IntPtr newResult, bool completed);
static nw_browser_browse_results_changed_handler_t static_ChangesHandler = TrampolineChangesHandler;
@ -199,7 +199,7 @@ namespace Network {
return;
}
BlockLiteral block_handler = new BlockLiteral ();
BlockLiteral *block_ptr_handler = &block_handler;
BlockLiteral* block_ptr_handler = &block_handler;
block_handler.SetupBlockUnsafe (static_ChangesHandler, handler);
try {
nw_browser_set_browse_results_changed_handler (GetCheckedHandle (), (void*) block_ptr_handler);
@ -216,7 +216,7 @@ namespace Network {
#endif
[DllImport (Constants.NetworkLibrary)]
unsafe static extern void nw_browser_set_state_changed_handler (OS_nw_browser browser, void *state_changed_handler);
unsafe static extern void nw_browser_set_state_changed_handler (OS_nw_browser browser, void* state_changed_handler);
delegate void nw_browser_set_state_changed_handler_t (IntPtr block, NWBrowserState state, IntPtr error);
static nw_browser_set_state_changed_handler_t static_StateChangesHandler = TrampolineStateChangesHandler;
@ -226,7 +226,7 @@ namespace Network {
{
var del = BlockLiteral.GetTarget<Action<NWBrowserState, NWError?>> (block);
if (del is not null) {
var nwError = (error == IntPtr.Zero)? null : new NWError (error, owns: false);
var nwError = (error == IntPtr.Zero) ? null : new NWError (error, owns: false);
del (state, nwError);
}
}
@ -240,7 +240,7 @@ namespace Network {
return;
}
BlockLiteral block_handler = new BlockLiteral ();
BlockLiteral *block_ptr_handler = &block_handler;
BlockLiteral* block_ptr_handler = &block_handler;
block_handler.SetupBlockUnsafe (static_StateChangesHandler, handler);
try {
nw_browser_set_state_changed_handler (GetCheckedHandle (), (void*) block_ptr_handler);

Просмотреть файл

@ -15,7 +15,7 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_browse_descriptor=System.IntPtr;
using OS_nw_browse_descriptor = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -29,15 +29,15 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[Watch (6,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
[Watch (6, 0)]
#endif
public class NWBrowserDescriptor: NativeObject {
public class NWBrowserDescriptor : NativeObject {
[Preserve (Conditional = true)]
internal NWBrowserDescriptor (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWBrowserDescriptor (NativeHandle handle, bool owns) : base (handle, owns) { }
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_browse_descriptor nw_browse_descriptor_create_bonjour_service (string type, string? domain);
@ -48,10 +48,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_browse_descriptor nw_browse_descriptor_create_application_service (string application_service_name);
@ -62,10 +62,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
public static NWBrowserDescriptor CreateApplicationServiceName (string applicationServiceName)
{
@ -81,10 +81,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern IntPtr nw_browse_descriptor_get_application_service_name (OS_nw_browse_descriptor descriptor);
@ -95,10 +95,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
public string? ApplicationServiceName {
get {

Просмотреть файл

@ -13,10 +13,10 @@ using System.Runtime.InteropServices;
using ObjCRuntime;
using Foundation;
using CoreFoundation;
using nw_connection_t=System.IntPtr;
using nw_endpoint_t=System.IntPtr;
using nw_parameters_t=System.IntPtr;
using nw_establishment_report_t=System.IntPtr;
using nw_connection_t = System.IntPtr;
using nw_endpoint_t = System.IntPtr;
using nw_parameters_t = System.IntPtr;
using nw_establishment_report_t = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -51,17 +51,17 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWConnection : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWConnection (NativeHandle handle, bool owns) : base (handle, owns) {}
#else
public NWConnection (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWConnection (NativeHandle handle, bool owns) : base (handle, owns) { }
#endif
[DllImport (Constants.NetworkLibrary)]
@ -106,7 +106,7 @@ namespace Network {
[MonoPInvokeCallback (typeof (StateChangeCallback))]
static void Trampoline_StateChangeCallback (IntPtr block, NWConnectionState state, IntPtr error)
{
var del = BlockLiteral.GetTarget<Action<NWConnectionState,NWError?>> (block);
var del = BlockLiteral.GetTarget<Action<NWConnectionState, NWError?>> (block);
if (del is not null) {
NWError? err = error != IntPtr.Zero ? new NWError (error, owns: false) : null;
del (state, err);
@ -114,10 +114,10 @@ namespace Network {
}
[DllImport (Constants.NetworkLibrary)]
unsafe static extern void nw_connection_set_state_changed_handler (nw_connection_t connection, void *handler);
unsafe static extern void nw_connection_set_state_changed_handler (nw_connection_t connection, void* handler);
[BindingImpl (BindingImplOptions.Optimizable)]
public unsafe void SetStateChangeHandler (Action<NWConnectionState,NWError?> stateHandler)
public unsafe void SetStateChangeHandler (Action<NWConnectionState, NWError?> stateHandler)
{
if (stateHandler is null) {
nw_connection_set_state_changed_handler (GetCheckedHandle (), null);
@ -126,7 +126,7 @@ namespace Network {
unsafe {
BlockLiteral block_handler = new BlockLiteral ();
BlockLiteral *block_ptr_handler = &block_handler;
BlockLiteral* block_ptr_handler = &block_handler;
block_handler.SetupBlockUnsafe (static_stateChangeHandler, stateHandler);
try {
@ -137,7 +137,7 @@ namespace Network {
}
}
delegate void nw_connection_boolean_event_handler_t (IntPtr block, [MarshalAs(UnmanagedType.U1)] bool value);
delegate void nw_connection_boolean_event_handler_t (IntPtr block, [MarshalAs (UnmanagedType.U1)] bool value);
static nw_connection_boolean_event_handler_t static_BooleanChangeHandler = TrampolineBooleanChangeHandler;
[MonoPInvokeCallback (typeof (nw_connection_boolean_event_handler_t))]
@ -149,7 +149,7 @@ namespace Network {
}
[DllImport (Constants.NetworkLibrary)]
static extern unsafe void nw_connection_set_viability_changed_handler (IntPtr handle, void *callback);
static extern unsafe void nw_connection_set_viability_changed_handler (IntPtr handle, void* callback);
[BindingImpl (BindingImplOptions.Optimizable)]
public unsafe void SetBooleanChangeHandler (Action<bool> callback)
@ -161,7 +161,7 @@ namespace Network {
unsafe {
BlockLiteral block_handler = new BlockLiteral ();
BlockLiteral *block_ptr_handler = &block_handler;
BlockLiteral* block_ptr_handler = &block_handler;
block_handler.SetupBlockUnsafe (static_BooleanChangeHandler, callback);
try {
@ -173,7 +173,7 @@ namespace Network {
}
[DllImport (Constants.NetworkLibrary)]
static extern unsafe void nw_connection_set_better_path_available_handler (IntPtr handle, void *callback);
static extern unsafe void nw_connection_set_better_path_available_handler (IntPtr handle, void* callback);
[BindingImpl (BindingImplOptions.Optimizable)]
public unsafe void SetBetterPathAvailableHandler (Action<bool> callback)
@ -185,7 +185,7 @@ namespace Network {
unsafe {
BlockLiteral block_handler = new BlockLiteral ();
BlockLiteral *block_ptr_handler = &block_handler;
BlockLiteral* block_ptr_handler = &block_handler;
block_handler.SetupBlockUnsafe (static_BooleanChangeHandler, callback);
try {
@ -325,7 +325,7 @@ namespace Network {
if (del is not null) {
var dispatchData = (dispatchDataPtr != IntPtr.Zero) ? new DispatchData (dispatchDataPtr, owns: false) : null;
var spanData = new ReadOnlySpan<byte> (dispatchData?.ToArray () ?? Array.Empty<byte>());
var spanData = new ReadOnlySpan<byte> (dispatchData?.ToArray () ?? Array.Empty<byte> ());
del (spanData,
contentContext == IntPtr.Zero ? null : new NWContentContext (contentContext, owns: false),
isComplete,
@ -456,15 +456,15 @@ namespace Network {
static extern unsafe void nw_connection_send (IntPtr handle,
IntPtr dispatchData,
IntPtr contentContext,
[MarshalAs(UnmanagedType.U1)] bool isComplete,
void *callback);
[MarshalAs (UnmanagedType.U1)] bool isComplete,
void* callback);
//
// This has more uses than the current ones, we might want to introduce
// additional SendXxx methods to encode the few options that are currently
// configured via one of the three NWContentContext static properties
//
unsafe void LowLevelSend (IntPtr handle, DispatchData? buffer, IntPtr contentContext, bool isComplete, void *callback)
unsafe void LowLevelSend (IntPtr handle, DispatchData? buffer, IntPtr contentContext, bool isComplete, void* callback)
{
nw_connection_send (handle: GetCheckedHandle (),
dispatchData: buffer.GetHandle (),
@ -501,7 +501,7 @@ namespace Network {
unsafe {
BlockLiteral block_handler = new BlockLiteral ();
BlockLiteral *block_ptr_handler = &block_handler;
BlockLiteral* block_ptr_handler = &block_handler;
block_handler.SetupBlockUnsafe (static_SendCompletion, callback);
try {
@ -517,7 +517,7 @@ namespace Network {
if (context is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (context));
LowLevelSend (GetCheckedHandle (), buffer, context.Handle, isComplete, (void *) NWConnectionConstants._SendIdempotentContent);
LowLevelSend (GetCheckedHandle (), buffer, context.Handle, isComplete, (void*) NWConnectionConstants._SendIdempotentContent);
}
public void SendIdempotent (byte [] buffer, NWContentContext context, bool isComplete)
@ -579,7 +579,7 @@ namespace Network {
public void Batch (Action method)
{
BlockLiteral.SimpleCall (method, (arg)=> nw_connection_batch (GetCheckedHandle (), arg));
BlockLiteral.SimpleCall (method, (arg) => nw_connection_batch (GetCheckedHandle (), arg));
}
#if NET
@ -588,9 +588,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
unsafe static extern void nw_connection_access_establishment_report (IntPtr connection, IntPtr queue, ref BlockLiteral access_block);
@ -615,9 +615,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[BindingImpl (BindingImplOptions.Optimizable)]
public void GetEstablishmentReport (DispatchQueue queue, Action<NWEstablishmentReport> handler)

Просмотреть файл

@ -3,16 +3,16 @@ using System.Runtime.InteropServices;
using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_connection=System.IntPtr;
using OS_nw_connection_group=System.IntPtr;
using OS_nw_group_descriptor=System.IntPtr;
using OS_nw_parameters=System.IntPtr;
using OS_nw_content_context=System.IntPtr;
using OS_nw_path=System.IntPtr;
using OS_nw_endpoint=System.IntPtr;
using OS_nw_protocol_metadata=System.IntPtr;
using OS_nw_protocol_definition=System.IntPtr;
using OS_nw_protocol_options=System.IntPtr;
using OS_nw_connection = System.IntPtr;
using OS_nw_connection_group = System.IntPtr;
using OS_nw_group_descriptor = System.IntPtr;
using OS_nw_parameters = System.IntPtr;
using OS_nw_content_context = System.IntPtr;
using OS_nw_path = System.IntPtr;
using OS_nw_endpoint = System.IntPtr;
using OS_nw_protocol_metadata = System.IntPtr;
using OS_nw_protocol_definition = System.IntPtr;
using OS_nw_protocol_options = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -28,11 +28,11 @@ namespace Network {
// [SupportedOSPlatform ("ios14.0")]
// [SupportedOSPlatform ("maccatalyst14.0")]
#else
[TV (14,0)]
[Mac (11,0)]
[iOS (14,0)]
[Watch (7,0)]
[MacCatalyst (14,0)]
[TV (14, 0)]
[Mac (11, 0)]
[iOS (14, 0)]
[Watch (7, 0)]
[MacCatalyst (14, 0)]
#endif
public delegate void NWConnectionGroupReceiveDelegate (DispatchData content, NWContentContext context, bool isCompleted);
@ -42,11 +42,11 @@ namespace Network {
// [SupportedOSPlatform ("ios14.0")]
// [SupportedOSPlatform ("maccatalyst14.0")]
#else
[TV (14,0)]
[Mac (11,0)]
[iOS (14,0)]
[Watch (7,0)]
[MacCatalyst (14,0)]
[TV (14, 0)]
[Mac (11, 0)]
[iOS (14, 0)]
[Watch (7, 0)]
[MacCatalyst (14, 0)]
#endif
public delegate void NWConnectionGroupStateChangedDelegate (NWConnectionGroupState state, NWError? error);
@ -56,15 +56,15 @@ namespace Network {
[SupportedOSPlatform ("ios14.0")]
[SupportedOSPlatform ("maccatalyst14.0")]
#else
[TV (14,0)]
[Mac (11,0)]
[iOS (14,0)]
[Watch (7,0)]
[MacCatalyst (14,0)]
[TV (14, 0)]
[Mac (11, 0)]
[iOS (14, 0)]
[Watch (7, 0)]
[MacCatalyst (14, 0)]
#endif
public class NWConnectionGroup : NativeObject {
[Preserve (Conditional = true)]
protected internal NWConnectionGroup (NativeHandle handle, bool owns) : base (handle, owns) {}
protected internal NWConnectionGroup (NativeHandle handle, bool owns) : base (handle, owns) { }
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_connection_group nw_connection_group_create (OS_nw_group_descriptor group_descriptor, OS_nw_parameters parameters);
@ -186,7 +186,7 @@ namespace Network {
}
[DllImport (Constants.NetworkLibrary)]
unsafe static extern void nw_connection_group_send_message (OS_nw_connection_group group, /* [NullAllowed] DispatchData */ IntPtr content, /* [NullAllowed] */ OS_nw_endpoint endpoint, OS_nw_content_context context, BlockLiteral *handler);
unsafe static extern void nw_connection_group_send_message (OS_nw_connection_group group, /* [NullAllowed] DispatchData */ IntPtr content, /* [NullAllowed] */ OS_nw_endpoint endpoint, OS_nw_content_context context, BlockLiteral* handler);
delegate void nw_connection_group_send_completion_t (IntPtr block, IntPtr error);
static nw_connection_group_send_completion_t static_SendCompletion = TrampolineSendCompletion;
@ -229,7 +229,7 @@ namespace Network {
}
[DllImport (Constants.NetworkLibrary)]
unsafe static extern void nw_connection_group_set_receive_handler (OS_nw_connection_group group, uint maximum_message_size, [MarshalAs (UnmanagedType.I1)] bool reject_oversized_messages, BlockLiteral *handler);
unsafe static extern void nw_connection_group_set_receive_handler (OS_nw_connection_group group, uint maximum_message_size, [MarshalAs (UnmanagedType.I1)] bool reject_oversized_messages, BlockLiteral* handler);
delegate void nw_connection_group_receive_handler_t (IntPtr block, IntPtr content, IntPtr context, bool isCompleted);
static nw_connection_group_receive_handler_t static_ReceiveHandler = TrampolineReceiveHandler;
@ -265,9 +265,9 @@ namespace Network {
}
[DllImport (Constants.NetworkLibrary)]
unsafe static extern void nw_connection_group_set_state_changed_handler (OS_nw_connection_group group, BlockLiteral *handler);
unsafe static extern void nw_connection_group_set_state_changed_handler (OS_nw_connection_group group, BlockLiteral* handler);
delegate void nw_connection_group_state_changed_handler_t (IntPtr block, NWConnectionGroupState state , IntPtr error);
delegate void nw_connection_group_state_changed_handler_t (IntPtr block, NWConnectionGroupState state, IntPtr error);
static nw_connection_group_state_changed_handler_t static_StateChangedHandler = TrampolineStateChangedHandler;
[MonoPInvokeCallback (typeof (nw_connection_group_state_changed_handler_t))]
@ -305,11 +305,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_protocol_metadata nw_connection_group_copy_protocol_metadata (OS_nw_connection_group group, OS_nw_protocol_definition definition);
@ -320,13 +320,14 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
public NWProtocolMetadata? GetProtocolMetadata (NWContentContext context) {
public NWProtocolMetadata? GetProtocolMetadata (NWContentContext context)
{
if (context is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (context));
var ptr = nw_connection_group_copy_protocol_metadata (GetCheckedHandle (), context.Handle);
@ -339,11 +340,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_protocol_metadata nw_connection_group_copy_protocol_metadata_for_message (OS_nw_connection_group group, OS_nw_content_context context, OS_nw_protocol_definition definition);
@ -354,13 +355,14 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
public NWProtocolMetadata? GetProtocolMetadata (NWContentContext context, NWProtocolDefinition definition) {
public NWProtocolMetadata? GetProtocolMetadata (NWContentContext context, NWProtocolDefinition definition)
{
if (context is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (context));
if (definition is null)
@ -375,11 +377,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_connection nw_connection_group_extract_connection (OS_nw_connection_group group, OS_nw_endpoint endpoint, OS_nw_protocol_options protocolOptions);
@ -390,11 +392,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
public NWConnection? ExtractConnection (NWEndpoint endpoint, NWProtocolOptions protocolOptions)
{
@ -408,11 +410,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
@ -424,11 +426,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
public bool TryReinsertExtractedConnection (NWConnection connection)
{
@ -443,11 +445,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern void nw_connection_group_set_new_connection_handler (OS_nw_connection_group group, ref BlockLiteral connectionHandler);
@ -455,7 +457,7 @@ namespace Network {
delegate void nw_connection_group_new_connection_handler_t (IntPtr block, IntPtr connection);
static nw_connection_group_new_connection_handler_t static_SetNewConnectionHandler = TrampolineSetNewConnectionHandler;
[MonoPInvokeCallback (typeof (nw_connection_group_new_connection_handler_t ))]
[MonoPInvokeCallback (typeof (nw_connection_group_new_connection_handler_t))]
static void TrampolineSetNewConnectionHandler (IntPtr block, IntPtr connection)
{
var del = BlockLiteral.GetTarget<Action<NWConnection>> (block);
@ -472,11 +474,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[BindingImpl (BindingImplOptions.Optimizable)]
public void SetNewConnectionHandler (Action<NWConnection> handler)

Просмотреть файл

@ -31,10 +31,10 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWContentContext : NativeObject {
bool global;
@ -171,7 +171,7 @@ namespace Network {
[MonoPInvokeCallback (typeof (ProtocolIterator))]
static void TrampolineProtocolIterator (IntPtr block, IntPtr definition, IntPtr metadata)
{
var del = BlockLiteral.GetTarget<Action<NWProtocolDefinition?,NWProtocolMetadata?>> (block);
var del = BlockLiteral.GetTarget<Action<NWProtocolDefinition?, NWProtocolMetadata?>> (block);
if (del is not null) {
using NWProtocolDefinition? pdef = definition == IntPtr.Zero ? null : new NWProtocolDefinition (definition, owns: true);
using NWProtocolMetadata? meta = metadata == IntPtr.Zero ? null : new NWProtocolMetadata (metadata, owns: true);
@ -184,7 +184,7 @@ namespace Network {
static extern void nw_content_context_foreach_protocol_metadata (IntPtr handle, ref BlockLiteral callback);
[BindingImpl (BindingImplOptions.Optimizable)]
public void IterateProtocolMetadata (Action<NWProtocolDefinition?,NWProtocolMetadata?> callback)
public void IterateProtocolMetadata (Action<NWProtocolDefinition?, NWProtocolMetadata?> callback)
{
BlockLiteral block_handler = new BlockLiteral ();
block_handler.SetupBlockUnsafe (static_ProtocolIterator, callback);

Просмотреть файл

@ -17,9 +17,9 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_data_transfer_report=System.IntPtr;
using OS_nw_connection=System.IntPtr;
using OS_nw_interface=System.IntPtr;
using OS_nw_data_transfer_report = System.IntPtr;
using OS_nw_connection = System.IntPtr;
using OS_nw_interface = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -33,15 +33,15 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[Watch (6,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
[Watch (6, 0)]
#endif
public class NWDataTransferReport : NativeObject {
[Preserve (Conditional = true)]
internal NWDataTransferReport (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWDataTransferReport (NativeHandle handle, bool owns) : base (handle, owns) { }
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_data_transfer_report nw_connection_create_new_data_transfer_report (OS_nw_connection connection);
@ -186,11 +186,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern NWInterfaceRadioType nw_data_transfer_report_get_path_radio_type (OS_nw_data_transfer_report report, uint pathIndex);
@ -201,11 +201,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
public NWInterfaceRadioType GetPathRadioType (uint pathIndex)
=> nw_data_transfer_report_get_path_radio_type (GetCheckedHandle (), pathIndex);
@ -217,11 +217,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[Obsolete ("Use the 'GetPathRadioType' property instead.")]
[EditorBrowsable (EditorBrowsableState.Never)]

Просмотреть файл

@ -16,8 +16,8 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_endpoint=System.IntPtr;
using OS_nw_txt_record=System.IntPtr;
using OS_nw_endpoint = System.IntPtr;
using OS_nw_txt_record = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -31,10 +31,10 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWEndpoint : NativeObject {
@ -42,7 +42,7 @@ namespace Network {
#if NET
internal NWEndpoint (NativeHandle handle, bool owns) : base (handle, owns) {}
#else
public NWEndpoint (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWEndpoint (NativeHandle handle, bool owns) : base (handle, owns) { }
#endif
[DllImport (Constants.NetworkLibrary)]
@ -133,9 +133,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[DllImport (Constants.NetworkLibrary, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
static extern OS_nw_endpoint nw_endpoint_create_url (string url);
@ -146,9 +146,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
public static NWEndpoint? Create (string url)
{
@ -166,9 +166,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[DllImport (Constants.NetworkLibrary, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr nw_endpoint_get_url (OS_nw_endpoint endpoint);
@ -179,9 +179,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
public string? Url => Marshal.PtrToStringAnsi (nw_endpoint_get_url (GetCheckedHandle ()));
@ -192,10 +192,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern unsafe byte* nw_endpoint_get_signature (OS_nw_endpoint endpoint, out nuint out_signature_length);
@ -206,16 +206,16 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
public ReadOnlySpan<byte> Signature {
get {
unsafe {
var data = nw_endpoint_get_signature (GetCheckedHandle (), out var length);
var mValue = new ReadOnlySpan<byte> (data, (int)length);
var mValue = new ReadOnlySpan<byte> (data, (int) length);
// we do not know who manages the byte array, so we return a copy, is more expensive but
// safer until we know what is the mem management.
return new ReadOnlySpan<byte> (mValue.ToArray ());
@ -229,10 +229,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_txt_record nw_endpoint_copy_txt_record (OS_nw_endpoint endpoint);
@ -243,10 +243,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
public NWTxtRecord? TxtRecord {
get {

Просмотреть файл

@ -15,13 +15,13 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_browse_result=System.IntPtr;
using OS_nw_endpoint=System.IntPtr;
using OS_nw_txt_record=System.IntPtr;
using OS_nw_browse_result = System.IntPtr;
using OS_nw_endpoint = System.IntPtr;
using OS_nw_txt_record = System.IntPtr;
namespace Network {
[Flags, TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)]
[Flags, TV (13, 0), Mac (10, 15), iOS (13, 0), Watch (6, 0)]
public enum NWBrowseResultChange : ulong {
Invalid = 0x00,
Identical = 0x01,
@ -32,7 +32,7 @@ namespace Network {
InterfaceRemoved = 0x10,
}
[TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)]
[TV (13, 0), Mac (10, 15), iOS (13, 0), Watch (6, 0)]
public enum NWBrowserState {
Invalid = 0,
Ready = 1,
@ -40,8 +40,8 @@ namespace Network {
Cancelled = 3,
}
[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
[TV (12, 0), Mac (10, 14), iOS (12, 0)]
[Watch (6, 0)]
public enum NWConnectionState {
Invalid = 0,
Waiting = 1,
@ -51,8 +51,8 @@ namespace Network {
Cancelled = 5,
}
[TV (14,0), Mac (11,0), iOS (14,0), Watch (7,0)]
[MacCatalyst (14,0)]
[TV (14, 0), Mac (11, 0), iOS (14, 0), Watch (7, 0)]
[MacCatalyst (14, 0)]
public enum NWConnectionGroupState {
Invalid = 0,
Waiting = 1,
@ -61,31 +61,31 @@ namespace Network {
Cancelled = 4,
}
[TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)]
[TV (13, 0), Mac (10, 15), iOS (13, 0), Watch (6, 0)]
public enum NWDataTransferReportState {
Collecting = 1,
Collected = 2,
}
[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
[TV (12, 0), Mac (10, 14), iOS (12, 0)]
[Watch (6, 0)]
public enum NWEndpointType {
Invalid = 0,
Address = 1,
Host = 2,
BonjourService = 3,
[TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)]
[TV (13, 0), Mac (10, 15), iOS (13, 0), Watch (6, 0)]
Url = 4,
}
[TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)]
[TV (13, 0), Mac (10, 15), iOS (13, 0), Watch (6, 0)]
public enum NWReportResolutionSource {
Query = 1,
Cache = 2,
ExpiredCache = 3,
}
[NoWatch, NoTV, NoiOS, Mac (10,15)]
[NoWatch, NoTV, NoiOS, Mac (10, 15)]
public enum NWEthernetChannelState {
Invalid = 0,
Waiting = 1,
@ -97,35 +97,35 @@ namespace Network {
// from System/Library/Frameworks/Network.framework/Headers/framer_options.h:
[Flags]
[TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)]
[TV (13, 0), Mac (10, 15), iOS (13, 0), Watch (6, 0)]
public enum NWFramerCreateFlags : uint {
Default = 0x00,
}
// from System/Library/Frameworks/Network.framework/Headers/framer_options.h:
[TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)]
[TV (13, 0), Mac (10, 15), iOS (13, 0), Watch (6, 0)]
public enum NWFramerStartResult {
Unknown = 0,
Ready = 1,
WillMarkReady = 2,
}
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
public enum NWIPLocalAddressPreference {
Default = 0,
Temporary = 1,
Stable = 2,
}
[Watch (6,0), TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6, 0), TV (12, 0), Mac (10, 14), iOS (12, 0)]
public enum NWIPVersion {
Any = 0,
Version4 = 1,
Version6 = 2,
}
[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
[TV (12, 0), Mac (10, 14), iOS (12, 0)]
[Watch (6, 0)]
public enum NWInterfaceType {
Other = 0,
Wifi = 1,
@ -134,8 +134,8 @@ namespace Network {
Loopback = 4,
}
[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
[TV (12, 0), Mac (10, 14), iOS (12, 0)]
[Watch (6, 0)]
public enum NWListenerState {
Invalid = 0,
Waiting = 1,
@ -144,8 +144,8 @@ namespace Network {
Cancelled = 4,
}
[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
[TV (12, 0), Mac (10, 14), iOS (12, 0)]
[Watch (6, 0)]
public enum NWMultiPathService {
Disabled = 0,
Handover = 1,
@ -153,8 +153,8 @@ namespace Network {
Aggregate = 3,
}
[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
[TV (12, 0), Mac (10, 14), iOS (12, 0)]
[Watch (6, 0)]
public enum NWParametersExpiredDnsBehavior {
Default = 0,
Allow = 1,
@ -162,8 +162,8 @@ namespace Network {
}
// this maps to `nw_path_status_t` in Network/Headers/path.h (and not the enum from NetworkExtension)
[TV (12,0), Mac (10,14), iOS (12,0)]
[Watch (6,0)]
[TV (12, 0), Mac (10, 14), iOS (12, 0)]
[Watch (6, 0)]
public enum NWPathStatus {
Invalid = 0,
Satisfied = 1,
@ -187,7 +187,7 @@ namespace Network {
Ce = 3,
}
[TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)]
[TV (13, 0), Mac (10, 15), iOS (13, 0), Watch (6, 0)]
public enum NWTxtRecordFindKey {
Invalid = 0,
NotPresent = 1,
@ -196,7 +196,7 @@ namespace Network {
NonEmptyValue = 4,
}
[TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)]
[TV (13, 0), Mac (10, 15), iOS (13, 0), Watch (6, 0)]
public enum NWWebSocketOpCode : int {
Cont = 0x0,
Text = 0x1,
@ -207,7 +207,7 @@ namespace Network {
Invalid = -1,
}
[TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)]
[TV (13, 0), Mac (10, 15), iOS (13, 0), Watch (6, 0)]
public enum NWWebSocketCloseCode : int {
NormalClosure = 1000,
GoingAway = 1001,
@ -224,20 +224,20 @@ namespace Network {
}
// this maps to `nw_ws_version_t` in Network.framework/Headers/ws_options.h (and not the enum from NetworkExtension)
[TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)]
[TV (13, 0), Mac (10, 15), iOS (13, 0), Watch (6, 0)]
public enum NWWebSocketVersion {
Invalid = 0,
Version13 = 1,
}
[TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)]
[TV (13, 0), Mac (10, 15), iOS (13, 0), Watch (6, 0)]
public enum NWWebSocketResponseStatus {
Invalid = 0,
Accept = 1,
Reject = 2,
}
[TV (15,0), Mac (12,0), iOS (15,0), Watch (8,0), MacCatalyst (15,0)]
[TV (15, 0), Mac (12, 0), iOS (15, 0), Watch (8, 0), MacCatalyst (15, 0)]
public enum NWReportResolutionProtocol {
Unknown = 0,
Udp = 1,
@ -246,7 +246,7 @@ namespace Network {
Https = 4,
}
[Watch (7,0), TV (14,0), Mac (11,0), iOS (14,0)]
[Watch (7, 0), TV (14, 0), Mac (11, 0), iOS (14, 0)]
public enum NWResolverConfigEndpointType {
Https,
Tls,
@ -280,13 +280,13 @@ namespace Network {
CellEvdo = 0x88,
}
[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)]
[Watch (8, 0), TV (15, 0), Mac (12, 0), iOS (15, 0)]
public enum NWParametersAttribution {
Developer = 1,
User = 2,
}
[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Watch (8, 0), TV (15, 0), Mac (12, 0), iOS (15, 0), MacCatalyst (15, 0)]
public enum NWQuicStreamType {
Unknown = 0,
Bidirectional = 1,

Просмотреть файл

@ -27,10 +27,10 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWError : NativeObject {
[Preserve (Conditional = true)]

Просмотреть файл

@ -17,11 +17,11 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_establishment_report=System.IntPtr;
using nw_endpoint_t=System.IntPtr;
using nw_report_protocol_enumerator_t=System.IntPtr;
using nw_protocol_definition_t=System.IntPtr;
using nw_resolution_report_t=System.IntPtr;
using OS_nw_establishment_report = System.IntPtr;
using nw_endpoint_t = System.IntPtr;
using nw_report_protocol_enumerator_t = System.IntPtr;
using nw_protocol_definition_t = System.IntPtr;
using nw_resolution_report_t = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -35,15 +35,15 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[Watch (6,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
[Watch (6, 0)]
#endif
public class NWEstablishmentReport : NativeObject {
[Preserve (Conditional = true)]
internal NWEstablishmentReport (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWEstablishmentReport (NativeHandle handle, bool owns) : base (handle, owns) { }
[DllImport (Constants.NetworkLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
@ -85,7 +85,7 @@ namespace Network {
if (del is not null) {
using (var nwSuccesfulEndpoint = new NWEndpoint (successful_endpoint, owns: false))
using (var nwPreferredEndpoint = new NWEndpoint (preferred_endpoint, owns: false))
del (source,TimeSpan.FromMilliseconds (milliseconds), endpoint_count, nwSuccesfulEndpoint, nwPreferredEndpoint);
del (source, TimeSpan.FromMilliseconds (milliseconds), endpoint_count, nwSuccesfulEndpoint, nwPreferredEndpoint);
}
}
@ -141,7 +141,7 @@ namespace Network {
public NWEndpoint? ProxyEndpoint {
get {
var ptr = nw_establishment_report_copy_proxy_endpoint (GetCheckedHandle ());
return (ptr == IntPtr.Zero) ? null : new NWEndpoint (ptr, owns:true);
return (ptr == IntPtr.Zero) ? null : new NWEndpoint (ptr, owns: true);
}
}
@ -151,11 +151,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern void nw_establishment_report_enumerate_resolution_reports (OS_nw_establishment_report report, ref BlockLiteral enumerateBlock);
@ -179,11 +179,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[BindingImpl (BindingImplOptions.Optimizable)]
public void EnumerateResolutionReports (Action<NWResolutionReport> handler)

Просмотреть файл

@ -16,13 +16,13 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_framer=System.IntPtr;
using OS_nw_protocol_metadata=System.IntPtr;
using OS_dispatch_data=System.IntPtr;
using OS_nw_protocol_definition=System.IntPtr;
using OS_nw_protocol_options=System.IntPtr;
using OS_nw_endpoint=System.IntPtr;
using OS_nw_parameters=System.IntPtr;
using OS_nw_framer = System.IntPtr;
using OS_nw_protocol_metadata = System.IntPtr;
using OS_dispatch_data = System.IntPtr;
using OS_nw_protocol_definition = System.IntPtr;
using OS_nw_protocol_options = System.IntPtr;
using OS_nw_endpoint = System.IntPtr;
using OS_nw_parameters = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -39,14 +39,14 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[Watch (6,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
[Watch (6, 0)]
#endif
public class NWFramer : NativeObject {
[Preserve (Conditional = true)]
internal NWFramer (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWFramer (NativeHandle handle, bool owns) : base (handle, owns) { }
[DllImport (Constants.NetworkLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
@ -65,18 +65,18 @@ namespace Network {
}
[DllImport (Constants.NetworkLibrary)]
unsafe static extern void nw_framer_write_output (OS_nw_framer framer, byte *output_buffer, nuint output_length);
unsafe static extern void nw_framer_write_output (OS_nw_framer framer, byte* output_buffer, nuint output_length);
public void WriteOutput (ReadOnlySpan<byte> data)
{
unsafe {
fixed (byte *mh = data)
fixed (byte* mh = data)
nw_framer_write_output (GetCheckedHandle (), mh, (nuint) data.Length);
}
}
[DllImport (Constants.NetworkLibrary)]
unsafe static extern void nw_framer_set_wakeup_handler (OS_nw_framer framer, void *wakeup_handler);
unsafe static extern void nw_framer_set_wakeup_handler (OS_nw_framer framer, void* wakeup_handler);
delegate void nw_framer_set_wakeup_handler_t (IntPtr block, OS_nw_framer framer);
static nw_framer_set_wakeup_handler_t static_WakeupHandler = TrampolineWakeupHandler;
@ -100,7 +100,7 @@ namespace Network {
return;
}
BlockLiteral block_handler = new BlockLiteral ();
BlockLiteral *block_ptr_handler = &block_handler;
BlockLiteral* block_ptr_handler = &block_handler;
block_handler.SetupBlockUnsafe (static_WakeupHandler, value);
try {
nw_framer_set_wakeup_handler (GetCheckedHandle (), (void*) block_ptr_handler);
@ -112,7 +112,7 @@ namespace Network {
}
[DllImport (Constants.NetworkLibrary)]
unsafe static extern void nw_framer_set_stop_handler (OS_nw_framer framer, void *stop_handler);
unsafe static extern void nw_framer_set_stop_handler (OS_nw_framer framer, void* stop_handler);
delegate void nw_framer_set_stop_handler_t (IntPtr block, OS_nw_framer framer);
static nw_framer_set_stop_handler_t static_StopHandler = TrampolineStopHandler;
@ -136,7 +136,7 @@ namespace Network {
return;
}
BlockLiteral block_handler = new BlockLiteral ();
BlockLiteral *block_ptr_handler = &block_handler;
BlockLiteral* block_ptr_handler = &block_handler;
block_handler.SetupBlockUnsafe (static_StopHandler, value);
try {
nw_framer_set_stop_handler (GetCheckedHandle (), (void*) block_ptr_handler);
@ -148,7 +148,7 @@ namespace Network {
}
[DllImport (Constants.NetworkLibrary)]
unsafe static extern void nw_framer_set_output_handler (OS_nw_framer framer, void *output_handler);
unsafe static extern void nw_framer_set_output_handler (OS_nw_framer framer, void* output_handler);
delegate void nw_framer_set_output_handler_t (IntPtr block, OS_nw_framer framer, OS_nw_protocol_metadata message, nuint message_length, bool is_complete);
static nw_framer_set_output_handler_t static_OutputHandler = TrampolineOutputHandler;
@ -173,7 +173,7 @@ namespace Network {
return;
}
BlockLiteral block_handler = new BlockLiteral ();
BlockLiteral *block_ptr_handler = &block_handler;
BlockLiteral* block_ptr_handler = &block_handler;
block_handler.SetupBlockUnsafe (static_OutputHandler, value);
try {
nw_framer_set_output_handler (GetCheckedHandle (), (void*) block_ptr_handler);
@ -185,7 +185,7 @@ namespace Network {
}
[DllImport (Constants.NetworkLibrary)]
unsafe static extern void nw_framer_set_input_handler (OS_nw_framer framer, void *input_handler);
unsafe static extern void nw_framer_set_input_handler (OS_nw_framer framer, void* input_handler);
delegate nuint nw_framer_set_input_handler_t (IntPtr block, OS_nw_framer framer);
static nw_framer_set_input_handler_t static_InputHandler = TrampolineInputHandler;
@ -210,7 +210,7 @@ namespace Network {
return;
}
BlockLiteral block_handler = new BlockLiteral ();
BlockLiteral *block_ptr_handler = &block_handler;
BlockLiteral* block_ptr_handler = &block_handler;
block_handler.SetupBlockUnsafe (static_InputHandler, value);
try {
nw_framer_set_input_handler (GetCheckedHandle (), (void*) block_ptr_handler);
@ -222,7 +222,7 @@ namespace Network {
}
[DllImport (Constants.NetworkLibrary)]
unsafe static extern void nw_framer_set_cleanup_handler (OS_nw_framer framer, void *cleanup_handler);
unsafe static extern void nw_framer_set_cleanup_handler (OS_nw_framer framer, void* cleanup_handler);
delegate void nw_framer_set_cleanup_handler_t (IntPtr block, OS_nw_framer framer);
static nw_framer_set_cleanup_handler_t static_CleanupHandler = TrampolineCleanupHandler;
@ -246,7 +246,7 @@ namespace Network {
return;
}
BlockLiteral block_handler = new BlockLiteral ();
BlockLiteral *block_ptr_handler = &block_handler;
BlockLiteral* block_ptr_handler = &block_handler;
block_handler.SetupBlockUnsafe (static_InputHandler, value);
try {
nw_framer_set_cleanup_handler (GetCheckedHandle (), (void*) block_ptr_handler);
@ -313,7 +313,7 @@ namespace Network {
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_protocol_options nw_framer_create_options (OS_nw_protocol_definition framer_definition);
public static T? CreateOptions<T> (NWProtocolDefinition protocolDefinition) where T: NWProtocolOptions
public static T? CreateOptions<T> (NWProtocolDefinition protocolDefinition) where T : NWProtocolOptions
{
if (protocolDefinition is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (protocolDefinition));
@ -337,7 +337,7 @@ namespace Network {
public NWEndpoint LocalEndpoint => new NWEndpoint (nw_framer_copy_local_endpoint (GetCheckedHandle ()), owns: true);
[DllImport (Constants.NetworkLibrary)]
unsafe static extern void nw_framer_async (OS_nw_framer framer, void *async_block);
unsafe static extern void nw_framer_async (OS_nw_framer framer, void* async_block);
delegate void nw_framer_async_t (IntPtr block);
static nw_framer_async_t static_ScheduleHandler = TrampolineScheduleHandler;
@ -360,7 +360,7 @@ namespace Network {
return;
}
BlockLiteral block_handler = new BlockLiteral ();
BlockLiteral *block_ptr_handler = &block_handler;
BlockLiteral* block_ptr_handler = &block_handler;
block_handler.SetupBlockUnsafe (static_ScheduleHandler, handler);
try {
nw_framer_async (GetCheckedHandle (), (void*) block_ptr_handler);
@ -372,7 +372,7 @@ namespace Network {
[DllImport (Constants.NetworkLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
static extern unsafe bool nw_framer_parse_output (OS_nw_framer framer, nuint minimum_incomplete_length, nuint maximum_length, byte *temp_buffer, ref BlockLiteral parse);
static extern unsafe bool nw_framer_parse_output (OS_nw_framer framer, nuint minimum_incomplete_length, nuint maximum_length, byte* temp_buffer, ref BlockLiteral parse);
delegate void nw_framer_parse_output_t (IntPtr block, IntPtr buffer, nuint buffer_length, bool is_complete);
static nw_framer_parse_output_t static_ParseOutputHandler = TrampolineParseOutputHandler;
@ -382,9 +382,9 @@ namespace Network {
{
var del = BlockLiteral.GetTarget<Action<Memory<byte>, bool>> (block);
if (del is not null) {
var bBuffer = new byte[buffer_length];
Marshal.Copy (buffer, bBuffer, 0, (int)buffer_length);
var mValue = new Memory<byte>(bBuffer);
var bBuffer = new byte [buffer_length];
Marshal.Copy (buffer, bBuffer, 0, (int) buffer_length);
var mValue = new Memory<byte> (bBuffer);
del (mValue, is_complete);
}
}
@ -399,7 +399,7 @@ namespace Network {
block_handler.SetupBlockUnsafe (static_ParseOutputHandler, handler);
try {
using (var mh = tempBuffer.Pin ())
return nw_framer_parse_output (GetCheckedHandle (), minimumIncompleteLength, maximumLength, (byte*)mh.Pointer, ref block_handler);
return nw_framer_parse_output (GetCheckedHandle (), minimumIncompleteLength, maximumLength, (byte*) mh.Pointer, ref block_handler);
} finally {
block_handler.CleanupBlock ();
}
@ -408,7 +408,7 @@ namespace Network {
[DllImport (Constants.NetworkLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
static extern unsafe bool nw_framer_parse_input (OS_nw_framer framer, nuint minimum_incomplete_length, nuint maximum_length, byte *temp_buffer, ref BlockLiteral parse);
static extern unsafe bool nw_framer_parse_input (OS_nw_framer framer, nuint minimum_incomplete_length, nuint maximum_length, byte* temp_buffer, ref BlockLiteral parse);
delegate nuint nw_framer_parse_input_t (IntPtr block, IntPtr buffer, nuint buffer_length, bool is_complete);
static nw_framer_parse_input_t static_ParseInputHandler = TrampolineParseInputHandler;
@ -418,9 +418,9 @@ namespace Network {
{
var del = BlockLiteral.GetTarget<NWFramerParseCompletionDelegate> (block);
if (del is not null) {
var bBuffer = new byte[buffer_length];
Marshal.Copy (buffer, bBuffer, 0, (int)buffer_length);
var mValue = new Memory<byte>(bBuffer);
var bBuffer = new byte [buffer_length];
Marshal.Copy (buffer, bBuffer, 0, (int) buffer_length);
var mValue = new Memory<byte> (bBuffer);
return del (mValue, is_complete);
}
return 0;
@ -436,7 +436,7 @@ namespace Network {
block_handler.SetupBlockUnsafe (static_ParseInputHandler, handler);
try {
using (var mh = tempBuffer.Pin ())
return nw_framer_parse_input (GetCheckedHandle (), minimumIncompleteLength, maximumLength, (byte*)mh.Pointer, ref block_handler);
return nw_framer_parse_input (GetCheckedHandle (), minimumIncompleteLength, maximumLength, (byte*) mh.Pointer, ref block_handler);
} finally {
block_handler.CleanupBlock ();
}
@ -444,15 +444,15 @@ namespace Network {
}
[DllImport (Constants.NetworkLibrary)]
unsafe static extern void nw_framer_deliver_input (OS_nw_framer framer, byte *input_buffer, nuint input_length, OS_nw_protocol_metadata message, [MarshalAs (UnmanagedType.I1)] bool is_complete);
unsafe static extern void nw_framer_deliver_input (OS_nw_framer framer, byte* input_buffer, nuint input_length, OS_nw_protocol_metadata message, [MarshalAs (UnmanagedType.I1)] bool is_complete);
public void DeliverInput (ReadOnlySpan<byte> buffer, NWFramerMessage message, bool isComplete)
{
if (message is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (message));
unsafe {
fixed (byte *mh = buffer)
nw_framer_deliver_input (GetCheckedHandle (),mh, (nuint)buffer.Length, message.Handle, isComplete);
fixed (byte* mh = buffer)
nw_framer_deliver_input (GetCheckedHandle (), mh, (nuint) buffer.Length, message.Handle, isComplete);
}
}
@ -462,11 +462,11 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[MacCatalyst (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[MacCatalyst (16, 0)]
[Watch (9, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_protocol_options nw_framer_copy_options (OS_nw_framer framer);
@ -477,11 +477,11 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[MacCatalyst (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[MacCatalyst (16, 0)]
[Watch (9, 0)]
#endif
public NSProtocolFramerOptions? ProtocolOptions {
get {

Просмотреть файл

@ -16,13 +16,13 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_framer=System.IntPtr;
using OS_nw_protocol_metadata=System.IntPtr;
using OS_dispatch_data=System.IntPtr;
using OS_nw_protocol_definition=System.IntPtr;
using OS_nw_protocol_options=System.IntPtr;
using OS_nw_endpoint=System.IntPtr;
using OS_nw_parameters=System.IntPtr;
using OS_nw_framer = System.IntPtr;
using OS_nw_protocol_metadata = System.IntPtr;
using OS_dispatch_data = System.IntPtr;
using OS_nw_protocol_definition = System.IntPtr;
using OS_nw_protocol_options = System.IntPtr;
using OS_nw_endpoint = System.IntPtr;
using OS_nw_parameters = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -36,14 +36,14 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[Watch (6,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
[Watch (6, 0)]
#endif
public class NWFramerMessage : NWProtocolMetadata {
[Preserve (Conditional = true)]
internal NWFramerMessage (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWFramerMessage (NativeHandle handle, bool owns) : base (handle, owns) { }
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_protocol_metadata nw_framer_protocol_create_message (OS_nw_protocol_definition definition);
@ -74,7 +74,7 @@ namespace Network {
}
[BindingImpl (BindingImplOptions.Optimizable)]
public void SetData (string key, byte[] value)
public void SetData (string key, byte [] value)
{
// the method takes a callback to cleanup the data, but we do not need that since we are managed
if (key is null)
@ -113,7 +113,8 @@ namespace Network {
}
[BindingImpl (BindingImplOptions.Optimizable)]
public bool GetData (string key, int dataLength, out ReadOnlySpan<byte> outData) {
public bool GetData (string key, int dataLength, out ReadOnlySpan<byte> outData)
{
IntPtr outPointer = IntPtr.Zero;
// create a function that will get the data, and the data length passed and will set the out param returning the value
Func<IntPtr, bool> callback = (inData) => {
@ -132,7 +133,7 @@ namespace Network {
var found = nw_framer_message_access_value (GetCheckedHandle (), key, ref block_handler);
if (found) {
unsafe {
outData = new ReadOnlySpan<byte>((void*) outPointer, dataLength);
outData = new ReadOnlySpan<byte> ((void*) outPointer, dataLength);
}
} else {
outData = ReadOnlySpan<byte>.Empty;

Просмотреть файл

@ -26,17 +26,17 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWIPMetadata : NWProtocolMetadata {
[Preserve (Conditional = true)]
internal NWIPMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWIPMetadata (NativeHandle handle, bool owns) : base (handle, owns) { }
public NWIPMetadata () : this (nw_ip_create_metadata (), owns: true) {}
public NWIPMetadata () : this (nw_ip_create_metadata (), owns: true) { }
public NWIPEcnFlag EcnFlag {
get => nw_ip_metadata_get_ecn_flag (GetCheckedHandle ());

Просмотреть файл

@ -16,7 +16,7 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_interface=System.IntPtr;
using OS_nw_interface = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -30,17 +30,17 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWInterface : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWInterface (NativeHandle handle, bool owns) : base (handle, owns) {}
#else
public NWInterface (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWInterface (NativeHandle handle, bool owns) : base (handle, owns) { }
#endif
[DllImport (Constants.NetworkLibrary)]

Просмотреть файл

@ -15,7 +15,7 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using nw_connection_group_t=System.IntPtr;
using nw_connection_group_t = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -29,10 +29,10 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWListener : NativeObject {
bool connectionHandlerWasSet = false;
@ -115,7 +115,8 @@ namespace Network {
[DllImport (Constants.NetworkLibrary)]
extern static void nw_listener_start (IntPtr handle);
public void Start () {
public void Start ()
{
lock (connectionHandlerLock) {
// we will get a sigabort if the handler is not set, lets be nicer.
if (!connectionHandlerWasSet)
@ -135,8 +136,8 @@ namespace Network {
[MonoPInvokeCallback (typeof (nw_listener_state_changed_handler_t))]
static void TrampolineListenerStateChanged (IntPtr block, NWListenerState state, IntPtr nwerror)
{
var del = BlockLiteral.GetTarget<Action<NWListenerState,NWError?>> (block);
if (del is not null){
var del = BlockLiteral.GetTarget<Action<NWListenerState, NWError?>> (block);
if (del is not null) {
NWError? err = nwerror == IntPtr.Zero ? null : new NWError (nwerror, owns: false);
del (state, err);
err?.Dispose ();
@ -144,19 +145,19 @@ namespace Network {
}
[DllImport (Constants.NetworkLibrary)]
static extern unsafe void nw_listener_set_state_changed_handler (IntPtr handle, void *callback);
static extern unsafe void nw_listener_set_state_changed_handler (IntPtr handle, void* callback);
[BindingImpl (BindingImplOptions.Optimizable)]
public void SetStateChangedHandler (Action<NWListenerState,NWError?> callback)
public void SetStateChangedHandler (Action<NWListenerState, NWError?> callback)
{
unsafe {
if (callback is null){
if (callback is null) {
nw_listener_set_state_changed_handler (GetCheckedHandle (), null);
return;
}
BlockLiteral block_handler = new BlockLiteral ();
BlockLiteral *block_ptr_handler = &block_handler;
BlockLiteral* block_ptr_handler = &block_handler;
block_handler.SetupBlockUnsafe (static_ListenerStateChanged, callback);
try {
@ -174,14 +175,14 @@ namespace Network {
static void TrampolineNewConnection (IntPtr block, IntPtr connection)
{
var del = BlockLiteral.GetTarget<Action<NWConnection>> (block);
if (del is not null){
if (del is not null) {
var nwconnection = new NWConnection (connection, owns: false);
del (nwconnection);
}
}
[DllImport (Constants.NetworkLibrary)]
static extern unsafe void nw_listener_set_new_connection_handler (IntPtr handle, void *callback);
static extern unsafe void nw_listener_set_new_connection_handler (IntPtr handle, void* callback);
[BindingImpl (BindingImplOptions.Optimizable)]
public void SetNewConnectionHandler (Action<NWConnection> callback)
@ -194,7 +195,7 @@ namespace Network {
}
BlockLiteral block_handler = new BlockLiteral ();
BlockLiteral *block_ptr_handler = &block_handler;
BlockLiteral* block_ptr_handler = &block_handler;
block_handler.SetupBlockUnsafe (static_NewConnection, callback);
try {
@ -223,19 +224,19 @@ namespace Network {
}
[DllImport (Constants.NetworkLibrary)]
static extern unsafe void nw_listener_set_advertised_endpoint_changed_handler (IntPtr handle, void *callback);
static extern unsafe void nw_listener_set_advertised_endpoint_changed_handler (IntPtr handle, void* callback);
[BindingImpl (BindingImplOptions.Optimizable)]
public void SetAdvertisedEndpointChangedHandler (AdvertisedEndpointChanged callback)
{
unsafe {
if (callback is null){
if (callback is null) {
nw_listener_set_advertised_endpoint_changed_handler (GetCheckedHandle (), null);
return;
}
BlockLiteral block_handler = new BlockLiteral ();
BlockLiteral *block_ptr_handler = &block_handler;
BlockLiteral* block_ptr_handler = &block_handler;
block_handler.SetupBlockUnsafe (static_AdvertisedEndpointChangedHandler, callback);
try {
@ -260,9 +261,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern uint nw_listener_get_new_connection_limit (IntPtr listener);
@ -273,9 +274,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern void nw_listener_set_new_connection_limit (IntPtr listener, uint new_connection_limit);
@ -286,9 +287,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
public uint ConnectionLimit {
get => nw_listener_get_new_connection_limit (GetCheckedHandle ());
@ -301,11 +302,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern void nw_listener_set_new_connection_group_handler (IntPtr listener, /* [NullAllowed] */ ref BlockLiteral handler);
@ -329,11 +330,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[BindingImpl (BindingImplOptions.Optimizable)]
public void SetNewConnectionGroupHandler (Action<NWConnectionGroup> handler)

Просмотреть файл

@ -3,8 +3,8 @@ using System.Runtime.InteropServices;
using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_group_descriptor=System.IntPtr;
using OS_nw_endpoint=System.IntPtr;
using OS_nw_group_descriptor = System.IntPtr;
using OS_nw_endpoint = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -20,15 +20,15 @@ namespace Network {
[SupportedOSPlatform ("ios14.0")]
[SupportedOSPlatform ("maccatalyst14.0")]
#else
[TV (14,0)]
[Mac (11,0)]
[iOS (14,0)]
[Watch (7,0)]
[MacCatalyst (14,0)]
[TV (14, 0)]
[Mac (11, 0)]
[iOS (14, 0)]
[Watch (7, 0)]
[MacCatalyst (14, 0)]
#endif
public class NWMulticastGroup : NativeObject {
[Preserve (Conditional = true)]
internal NWMulticastGroup (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWMulticastGroup (NativeHandle handle, bool owns) : base (handle, owns) { }
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_group_descriptor nw_group_descriptor_create_multicast (OS_nw_endpoint multicast_group);

Просмотреть файл

@ -3,8 +3,8 @@ using System.Runtime.InteropServices;
using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_group_descriptor=System.IntPtr;
using OS_nw_endpoint=System.IntPtr;
using OS_nw_group_descriptor = System.IntPtr;
using OS_nw_endpoint = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -20,11 +20,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
public class NWMultiplexGroup : NWMulticastGroup {
@ -32,7 +32,7 @@ namespace Network {
static extern OS_nw_group_descriptor nw_group_descriptor_create_multiplex (OS_nw_endpoint remoteEndpoint);
[Preserve (Conditional = true)]
internal NWMultiplexGroup (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWMultiplexGroup (NativeHandle handle, bool owns) : base (handle, owns) { }
public NWMultiplexGroup (NWEndpoint endpoint)
: base (nw_group_descriptor_create_multiplex (endpoint.GetCheckedHandle ()), true) { }

Просмотреть файл

@ -16,10 +16,10 @@ using Foundation;
using ObjCRuntime;
using CoreFoundation;
using nw_parameters_t=System.IntPtr;
using OS_nw_parameters=System.IntPtr;
using nw_parameters_attribution_t=System.IntPtr;
using OS_nw_privacy_context=System.IntPtr;
using nw_parameters_t = System.IntPtr;
using OS_nw_parameters = System.IntPtr;
using nw_parameters_attribution_t = System.IntPtr;
using OS_nw_privacy_context = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -33,17 +33,17 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWParameters : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWParameters (NativeHandle handle, bool owns) : base (handle, owns) {}
#else
public NWParameters (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWParameters (NativeHandle handle, bool owns) : base (handle, owns) { }
#endif
#if NET
@ -52,10 +52,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_parameters nw_parameters_create_application_service ();
@ -66,16 +66,16 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
public static NWParameters CreateApplicationService () => new NWParameters (nw_parameters_create_application_service (), true);
static unsafe BlockLiteral *DEFAULT_CONFIGURATION () => (BlockLiteral *) NWParametersConstants._DefaultConfiguration;
static unsafe BlockLiteral* DEFAULT_CONFIGURATION () => (BlockLiteral*) NWParametersConstants._DefaultConfiguration;
static unsafe BlockLiteral *DISABLE_PROTOCOL () => (BlockLiteral *) NWParametersConstants._ProtocolDisable;
static unsafe BlockLiteral* DISABLE_PROTOCOL () => (BlockLiteral*) NWParametersConstants._ProtocolDisable;
delegate void nw_parameters_configure_protocol_block_t (IntPtr block, IntPtr iface);
static nw_parameters_configure_protocol_block_t static_ConfigureHandler = TrampolineConfigureHandler;
@ -111,7 +111,7 @@ namespace Network {
}
[DllImport (Constants.NetworkLibrary)]
static unsafe extern nw_parameters_t nw_parameters_create_secure_tcp (void *configure_tls, void *configure_tcp);
static unsafe extern nw_parameters_t nw_parameters_create_secure_tcp (void* configure_tls, void* configure_tcp);
//
// If you pass null, to either configureTls, or configureTcp they will use the default options
@ -168,7 +168,7 @@ namespace Network {
[DllImport (Constants.NetworkLibrary)]
static extern unsafe nw_parameters_t nw_parameters_create_secure_udp (void *configure_tls, void *configure_tcp);
static extern unsafe nw_parameters_t nw_parameters_create_secure_udp (void* configure_tls, void* configure_tcp);
//
// If you pass null, to either configureTls, or configureTcp they will use the default options
@ -179,8 +179,8 @@ namespace Network {
var tlsHandler = new BlockLiteral ();
var udpHandler = new BlockLiteral ();
BlockLiteral *tlsPtr = &tlsHandler;
BlockLiteral *udpPtr = &udpHandler;
BlockLiteral* tlsPtr = &tlsHandler;
BlockLiteral* udpPtr = &udpHandler;
if (configureTls is null)
tlsPtr = DEFAULT_CONFIGURATION ();
@ -409,7 +409,7 @@ namespace Network {
[return: MarshalAs (UnmanagedType.I1)]
static bool TrampolineIterateProhibitedHandler (IntPtr block, IntPtr iface)
{
var del = BlockLiteral.GetTarget<Func<NWInterface,bool>> (block);
var del = BlockLiteral.GetTarget<Func<NWInterface, bool>> (block);
if (del is not null) {
var x = new NWInterface (iface, owns: false);
var ret = del (x);
@ -423,7 +423,7 @@ namespace Network {
static extern void nw_parameters_iterate_prohibited_interfaces (nw_parameters_t parameters, ref BlockLiteral callback);
[BindingImpl (BindingImplOptions.Optimizable)]
public void IterateProhibitedInterfaces (Func<NWInterface,bool> iterationCallback)
public void IterateProhibitedInterfaces (Func<NWInterface, bool> iterationCallback)
{
BlockLiteral block_handler = new BlockLiteral ();
block_handler.SetupBlockUnsafe (static_iterateProhibitedHandler, iterationCallback);
@ -442,7 +442,7 @@ namespace Network {
[return: MarshalAs (UnmanagedType.I1)]
static bool TrampolineIterateProhibitedTypeHandler (IntPtr block, NWInterfaceType type)
{
var del = BlockLiteral.GetTarget<Func<NWInterfaceType,bool>> (block);
var del = BlockLiteral.GetTarget<Func<NWInterfaceType, bool>> (block);
if (del is not null)
return del (type);
return false;
@ -452,7 +452,7 @@ namespace Network {
static extern void nw_parameters_iterate_prohibited_interface_types (IntPtr handle, ref BlockLiteral callback);
[BindingImpl (BindingImplOptions.Optimizable)]
public void IterateProhibitedInterfaces (Func<NWInterfaceType,bool> callback)
public void IterateProhibitedInterfaces (Func<NWInterfaceType, bool> callback)
{
BlockLiteral block_handler = new BlockLiteral ();
block_handler.SetupBlockUnsafe (static_IterateProhibitedTypeHandler, callback);
@ -550,9 +550,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
@ -564,9 +564,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern void nw_parameters_set_prohibit_constrained (IntPtr parameters, [MarshalAs (UnmanagedType.I1)] bool prohibit_constrained);
@ -577,9 +577,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
public bool ProhibitConstrained {
get => nw_parameters_get_prohibit_constrained (GetCheckedHandle ());
@ -592,11 +592,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern void nw_parameters_set_attribution (OS_nw_parameters parameters, NWParametersAttribution attribution);
@ -607,11 +607,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern NWParametersAttribution nw_parameters_get_attribution (OS_nw_parameters parameters);
@ -622,11 +622,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
public NWParametersAttribution Attribution {
get => nw_parameters_get_attribution (GetCheckedHandle ());
@ -639,11 +639,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern void nw_parameters_set_privacy_context (OS_nw_parameters parameters, OS_nw_privacy_context privacy_context);
@ -654,11 +654,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
public void SetPrivacyContext (NWPrivacyContext privacyContext)
=> nw_parameters_set_privacy_context (GetCheckedHandle (), privacyContext.Handle);
@ -669,14 +669,14 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static unsafe extern OS_nw_parameters nw_parameters_create_quic (void *configureQuic);
static unsafe extern OS_nw_parameters nw_parameters_create_quic (void* configureQuic);
#if NET
[SupportedOSPlatform ("tvos15.0")]
@ -684,11 +684,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[BindingImpl (BindingImplOptions.Optimizable)]
public static NWParameters CreateQuic (Action<NWProtocolOptions>? configureQuic = null)
@ -717,10 +717,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
[return: MarshalAs (UnmanagedType.I1)]
[DllImport (Constants.NetworkLibrary)]
@ -732,10 +732,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern void nw_parameters_set_requires_dnssec_validation (OS_nw_parameters parameters, [MarshalAs (UnmanagedType.I1)] bool requires_dnssec_validation);
@ -746,10 +746,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
public bool RequiresDnssecValidation {
get => nw_parameters_requires_dnssec_validation (GetCheckedHandle ());

Просмотреть файл

@ -29,17 +29,17 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWPath : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWPath (NativeHandle handle, bool owns) : base (handle, owns) {}
#else
public NWPath (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWPath (NativeHandle handle, bool owns) : base (handle, owns) { }
#endif
[DllImport (Constants.NetworkLibrary)]
@ -138,8 +138,7 @@ namespace Network {
if (callback is null)
return;
Func<NWInterface, bool> func = (v) =>
{
Func<NWInterface, bool> func = (v) => {
callback (v);
return true;
};
@ -169,9 +168,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
@ -183,9 +182,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
public bool IsConstrained => nw_path_is_constrained (GetCheckedHandle ());
@ -195,9 +194,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern void nw_path_enumerate_gateways (IntPtr path, ref BlockLiteral enumerate_block);
@ -224,16 +223,15 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[Obsolete ("Use the overload that takes a 'Func<NWEndpoint, bool>' instead.")]
[EditorBrowsable (EditorBrowsableState.Never)]
public void EnumerateGateways (Action<NWEndpoint> callback)
{
Func<NWEndpoint,bool> func = (v) =>
{
Func<NWEndpoint, bool> func = (v) => {
callback (v);
return true;
};
@ -247,9 +245,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[BindingImpl (BindingImplOptions.Optimizable)]
public void EnumerateGateways (Func<NWEndpoint, bool> callback)
@ -273,11 +271,11 @@ namespace Network {
[SupportedOSPlatform ("macos11.0")]
[SupportedOSPlatform ("maccatalyst14.2")]
#else
[iOS (14,2)]
[TV (14,2)]
[Watch (7,1)]
[Mac (11,0)]
[MacCatalyst (14,2)]
[iOS (14, 2)]
[TV (14, 2)]
[Watch (7, 1)]
[Mac (11, 0)]
[MacCatalyst (14, 2)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern NWPathUnsatisfiedReason /* nw_path_unsatisfied_reason_t */ nw_path_get_unsatisfied_reason (IntPtr /* OS_nw_path */ path);
@ -288,11 +286,11 @@ namespace Network {
[SupportedOSPlatform ("macos11.0")]
[SupportedOSPlatform ("maccatalyst14.2")]
#else
[iOS (14,2)]
[TV (14,2)]
[Watch (7,1)]
[Mac (11,0)]
[MacCatalyst (14,2)]
[iOS (14, 2)]
[TV (14, 2)]
[Watch (7, 1)]
[Mac (11, 0)]
[MacCatalyst (14, 2)]
#endif
public NWPathUnsatisfiedReason GetUnsatisfiedReason ()
{

Просмотреть файл

@ -16,7 +16,7 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_path_monitor=System.IntPtr;
using OS_nw_path_monitor = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -30,17 +30,17 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWPathMonitor : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWPathMonitor (NativeHandle handle, bool owns) : base (handle, owns) {}
#else
public NWPathMonitor (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWPathMonitor (NativeHandle handle, bool owns) : base (handle, owns) { }
#endif
[DllImport (Constants.NetworkLibrary)]
@ -100,7 +100,7 @@ namespace Network {
}
[DllImport (Constants.NetworkLibrary)]
static extern unsafe void nw_path_monitor_set_update_handler (IntPtr handle, void *callback);
static extern unsafe void nw_path_monitor_set_update_handler (IntPtr handle, void* callback);
[BindingImpl (BindingImplOptions.Optimizable)]
void _SetUpdatedSnapshotHandler (Action<NWPath> callback)
@ -112,7 +112,7 @@ namespace Network {
}
BlockLiteral block_handler = new BlockLiteral ();
BlockLiteral *block_ptr_handler = &block_handler;
BlockLiteral* block_ptr_handler = &block_handler;
block_handler.SetupBlockUnsafe (static_UpdateSnapshot, callback);
try {
@ -158,7 +158,7 @@ namespace Network {
}
[DllImport (Constants.NetworkLibrary)]
static extern unsafe void nw_path_monitor_set_cancel_handler (IntPtr handle, void *callback);
static extern unsafe void nw_path_monitor_set_cancel_handler (IntPtr handle, void* callback);
[BindingImpl (BindingImplOptions.Optimizable)]
public void SetMonitorCanceledHandler (Action callback)
@ -170,7 +170,7 @@ namespace Network {
}
BlockLiteral block_handler = new BlockLiteral ();
BlockLiteral *block_ptr_handler = &block_handler;
BlockLiteral* block_ptr_handler = &block_handler;
block_handler.SetupBlockUnsafe (static_MonitorCanceled, callback);
try {
@ -188,11 +188,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern void nw_path_monitor_prohibit_interface_type (OS_nw_path_monitor monitor, NWInterfaceType interfaceType);
@ -203,11 +203,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
public void ProhibitInterfaceType (NWInterfaceType interfaceType)
=> nw_path_monitor_prohibit_interface_type (GetCheckedHandle (), interfaceType);

Просмотреть файл

@ -5,8 +5,8 @@ using System.Runtime.InteropServices;
using ObjCRuntime;
using CoreFoundation;
using Foundation;
using OS_nw_privacy_context=System.IntPtr;
using OS_nw_resolver_config=System.IntPtr;
using OS_nw_privacy_context = System.IntPtr;
using OS_nw_resolver_config = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -19,11 +19,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
public class NWPrivacyContext : NativeObject {
@ -34,14 +34,14 @@ namespace Network {
#if NET
internal NWPrivacyContext (NativeHandle handle, bool owns) : base (handle, owns) {}
#else
public NWPrivacyContext (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWPrivacyContext (NativeHandle handle, bool owns) : base (handle, owns) { }
#endif
[DllImport (Constants.NetworkLibrary)]
static extern unsafe OS_nw_privacy_context nw_privacy_context_create (string description);
public NWPrivacyContext (string description)
: base (nw_privacy_context_create (description), true) {}
: base (nw_privacy_context_create (description), true) { }
[DllImport (Constants.NetworkLibrary)]
static extern void nw_privacy_context_flush_cache (OS_nw_privacy_context privacyContext);

Просмотреть файл

@ -16,7 +16,7 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_protocol_definition=System.IntPtr;
using OS_nw_protocol_definition = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -30,17 +30,17 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWProtocolDefinition : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWProtocolDefinition (NativeHandle handle, bool owns) : base (handle, owns) {}
#else
public NWProtocolDefinition (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWProtocolDefinition (NativeHandle handle, bool owns) : base (handle, owns) { }
#endif
[DllImport (Constants.NetworkLibrary)]
@ -102,17 +102,17 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_protocol_definition nw_protocol_copy_ws_definition ();
#if !NET
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
[Obsolete ("Use 'CreateWebSocketDefinition' method instead.")]
public static NWProtocolDefinition WebSocketDefinition => new NWProtocolDefinition (nw_protocol_copy_ws_definition (), owns: true);
#endif
@ -123,9 +123,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
public static NWProtocolDefinition CreateWebSocketDefinition () => new NWProtocolDefinition (nw_protocol_copy_ws_definition (), owns: true);
@ -135,9 +135,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern unsafe OS_nw_protocol_definition nw_framer_create_definition (string identifier, NWFramerCreateFlags flags, ref BlockLiteral start_handler);
@ -148,7 +148,7 @@ namespace Network {
static NWFramerStartResult TrampolineCreateFramerHandler (IntPtr block, IntPtr framer)
{
// get and call, this is internal and we are trying to do all the magic in the call
var del = BlockLiteral.GetTarget<Func<NWFramer,NWFramerStartResult>> (block);
var del = BlockLiteral.GetTarget<Func<NWFramer, NWFramerStartResult>> (block);
if (del is not null) {
var nwFramer = new NWFramer (framer, owns: true);
return del (nwFramer);
@ -162,9 +162,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[BindingImpl (BindingImplOptions.Optimizable)]
public static NWProtocolDefinition CreateFramerDefinition (string identifier, NWFramerCreateFlags flags, Func<NWFramer, NWFramerStartResult> startCallback)
@ -184,11 +184,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_protocol_definition nw_protocol_copy_quic_definition ();
@ -199,11 +199,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
public static NWProtocolDefinition CreateQuicDefinition () => new NWProtocolDefinition (nw_protocol_copy_quic_definition (), owns: true);
}

Просмотреть файл

@ -16,10 +16,10 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using Security;
using IntPtr=System.IntPtr;
using IntPtr = System.IntPtr;
#if !NET
using OS_nw_protocol_options=System.IntPtr;
using OS_nw_protocol_options = System.IntPtr;
using NativeHandle = System.IntPtr;
#else
using OS_nw_protocol_options=ObjCRuntime.NativeHandle;
@ -33,16 +33,16 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[MacCatalyst (16,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
[MacCatalyst (16, 0)]
#endif
public class NSProtocolFramerOptions : NWProtocolOptions {
[Preserve (Conditional = true)]
internal NSProtocolFramerOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NSProtocolFramerOptions (NativeHandle handle, bool owns) : base (handle, owns) { }
[DllImport (Constants.NetworkLibrary)]
static extern void nw_framer_options_set_object_value (OS_nw_protocol_options options, string key, NativeHandle value);
@ -53,7 +53,8 @@ namespace Network {
[DllImport (Constants.NetworkLibrary)]
static extern NativeHandle nw_framer_options_copy_object_value (OS_nw_protocol_options options, string key);
public T? GetValue<T> (string key) where T : NSObject {
public T? GetValue<T> (string key) where T : NSObject
{
var value = nw_framer_options_copy_object_value (GetCheckedHandle (), key);
return Runtime.GetNSObject<T> (value, owns: true);
}

Просмотреть файл

@ -16,9 +16,9 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using Security;
using OS_nw_protocol_definition=System.IntPtr;
using OS_nw_protocol_options=System.IntPtr;
using IntPtr=System.IntPtr;
using OS_nw_protocol_definition = System.IntPtr;
using OS_nw_protocol_options = System.IntPtr;
using IntPtr = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -32,14 +32,14 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[Watch (6,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
[Watch (6, 0)]
#endif
public class NWProtocolIPOptions : NWProtocolOptions {
[Preserve (Conditional = true)]
internal NWProtocolIPOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWProtocolIPOptions (NativeHandle handle, bool owns) : base (handle, owns) { }
public void SetVersion (NWIPVersion version)
=> nw_ip_options_set_version (GetCheckedHandle (), version);
@ -65,11 +65,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern void nw_ip_options_set_disable_multicast_loopback (OS_nw_protocol_options options, [MarshalAs (UnmanagedType.I1)] bool disableMulticastLoopback);
@ -80,11 +80,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
public void DisableMulticastLoopback (bool disable)
=> nw_ip_options_set_disable_multicast_loopback (GetCheckedHandle (), disable);

Просмотреть файл

@ -16,9 +16,9 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using Security;
using OS_nw_protocol_definition=System.IntPtr;
using OS_nw_protocol_metadata=System.IntPtr;
using nw_service_class_t=System.IntPtr;
using OS_nw_protocol_definition = System.IntPtr;
using OS_nw_protocol_metadata = System.IntPtr;
using nw_service_class_t = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -32,10 +32,10 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWProtocolMetadata : NativeObject {
@ -65,7 +65,7 @@ namespace Network {
#if NET
internal NWProtocolMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
#else
public NWProtocolMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWProtocolMetadata (NativeHandle handle, bool owns) : base (handle, owns) { }
#endif
[DllImport (Constants.NetworkLibrary)]
@ -103,11 +103,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
@ -119,11 +119,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
public bool IsQuic => nw_protocol_metadata_is_quic (GetCheckedHandle ());
@ -250,9 +250,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
@ -264,9 +264,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
public bool IsFramerMessage => nw_protocol_metadata_is_framer_message (GetCheckedHandle ());
@ -276,9 +276,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
@ -290,9 +290,9 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
public bool IsWebSocket => nw_protocol_metadata_is_ws (GetCheckedHandle ());
}

Просмотреть файл

@ -16,8 +16,8 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using Security;
using OS_nw_protocol_definition=System.IntPtr;
using IntPtr=System.IntPtr;
using OS_nw_protocol_definition = System.IntPtr;
using IntPtr = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -31,17 +31,17 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWProtocolOptions : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWProtocolOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
#else
public NWProtocolOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWProtocolOptions (NativeHandle handle, bool owns) : base (handle, owns) { }
#endif
[DllImport (Constants.NetworkLibrary)]
@ -90,11 +90,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
internal static extern IntPtr nw_quic_create_options ();
@ -107,9 +107,9 @@ namespace Network {
}
#endif
//
// IP Options
//
//
// IP Options
//
[DllImport (Constants.NetworkLibrary)]
internal static extern void nw_ip_options_set_version (IntPtr options, NWIPVersion version);
@ -155,7 +155,7 @@ namespace Network {
#endif // !NET
[DllImport (Constants.NetworkLibrary)]
internal static extern void nw_ip_options_set_calculate_receive_time (IntPtr options,[MarshalAs (UnmanagedType.I1)] bool calculateReceiveTime);
internal static extern void nw_ip_options_set_calculate_receive_time (IntPtr options, [MarshalAs (UnmanagedType.I1)] bool calculateReceiveTime);
#if !NET
[Obsolete ("Use the 'NWProtocolIPOptions' class instead.")]
@ -172,25 +172,25 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
internal static extern void nw_ip_options_set_local_address_preference (IntPtr options, NWIPLocalAddressPreference preference);
#if !NET
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
[Obsolete ("Use the 'NWProtocolIPOptions' class instead.")]
#endif
public NWIPLocalAddressPreference IPLocalAddressPreference {
set => nw_ip_options_set_local_address_preference (GetCheckedHandle (), value);
}
//
// TCP Options
//
//
// TCP Options
//
[DllImport (Constants.NetworkLibrary)]
internal extern static void nw_tcp_options_set_no_delay (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool noDelay);
@ -312,9 +312,9 @@ namespace Network {
public void TcpSetDisableEcn (bool disableEcn) => nw_tcp_options_set_disable_ecn (GetCheckedHandle (), disableEcn);
#endif // !NET
//
// UDP Options
//
//
// UDP Options
//
[DllImport (Constants.NetworkLibrary)]
internal extern static void nw_udp_options_set_prefer_no_checksum (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool preferNoChecksums);
@ -323,9 +323,9 @@ namespace Network {
public void UdpSetPreferNoChecksum (bool preferNoChecksums) => nw_udp_options_set_prefer_no_checksum (GetCheckedHandle (), preferNoChecksums);
#endif // !NET
//
// TLS options
//
//
// TLS options
//
[DllImport (Constants.NetworkLibrary)]
internal extern static IntPtr nw_tls_copy_sec_protocol_options (IntPtr options);
@ -341,11 +341,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
[return: MarshalAs (UnmanagedType.I1)]

Просмотреть файл

@ -23,18 +23,18 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
public class NWProtocolQuicOptions : NWProtocolOptions {
[Preserve (Conditional = true)]
internal NWProtocolQuicOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWProtocolQuicOptions (NativeHandle handle, bool owns) : base (handle, owns) { }
public NWProtocolQuicOptions () : this (nw_quic_create_options (), owns: true) {}
public NWProtocolQuicOptions () : this (nw_quic_create_options (), owns: true) { }
[DllImport (Constants.NetworkLibrary)]
static extern void nw_quic_add_tls_application_protocol (OS_nw_protocol_options options, string applicationProtocol);
@ -154,10 +154,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern ushort nw_quic_get_max_datagram_frame_size (OS_nw_protocol_options options);
@ -168,10 +168,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern void nw_quic_set_max_datagram_frame_size (OS_nw_protocol_options options, ushort max_datagram_frame_size);
@ -182,10 +182,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
public ushort DatagramFrameSize {
get => nw_quic_get_max_datagram_frame_size (GetCheckedHandle ());
@ -198,10 +198,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
@ -213,10 +213,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern void nw_quic_set_stream_is_datagram (OS_nw_protocol_options options, [MarshalAs (UnmanagedType.I1)] bool is_datagram);
@ -227,10 +227,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
public bool StreamIsDatagram {
get => nw_quic_get_stream_is_datagram (GetCheckedHandle ());
@ -243,10 +243,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern ushort nw_quic_get_stream_usable_datagram_frame_size (OS_nw_protocol_metadata metadata);
@ -257,10 +257,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
public ushort StreamUsableDatagramFrameSize => nw_quic_get_stream_usable_datagram_frame_size (GetCheckedHandle ());
@ -270,10 +270,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern byte nw_quic_get_stream_type (OS_nw_protocol_metadata stream_metadata);
@ -284,10 +284,10 @@ namespace Network {
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
#else
[TV (16,0)]
[Mac (13,0)]
[iOS (16,0)]
[Watch (9,0)]
[TV (16, 0)]
[Mac (13, 0)]
[iOS (16, 0)]
[Watch (9, 0)]
#endif
public NWQuicStreamType StreamType => (NWQuicStreamType) nw_quic_get_stream_type (GetCheckedHandle ());

Просмотреть файл

@ -15,11 +15,11 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_protocol_definition=System.IntPtr;
using OS_nw_protocol_metadata=System.IntPtr;
using nw_service_class_t=System.IntPtr;
using nw_protocol_stack_t=System.IntPtr;
using nw_protocol_options_t=System.IntPtr;
using OS_nw_protocol_definition = System.IntPtr;
using OS_nw_protocol_metadata = System.IntPtr;
using nw_service_class_t = System.IntPtr;
using nw_protocol_stack_t = System.IntPtr;
using nw_protocol_options_t = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -33,17 +33,17 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWProtocolStack : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWProtocolStack (NativeHandle handle, bool owns) : base (handle, owns) {}
#else
public NWProtocolStack (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWProtocolStack (NativeHandle handle, bool owns) : base (handle, owns) { }
#endif
[DllImport (Constants.NetworkLibrary)]

Просмотреть файл

@ -16,9 +16,9 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using Security;
using OS_nw_protocol_definition=System.IntPtr;
using OS_nw_protocol_options=System.IntPtr;
using IntPtr=System.IntPtr;
using OS_nw_protocol_definition = System.IntPtr;
using OS_nw_protocol_options = System.IntPtr;
using IntPtr = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -32,17 +32,17 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWProtocolTcpOptions : NWProtocolOptions {
[Preserve (Conditional = true)]
internal NWProtocolTcpOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWProtocolTcpOptions (NativeHandle handle, bool owns) : base (handle, owns) { }
public NWProtocolTcpOptions () : this (nw_tcp_create_options (), owns: true) {}
public NWProtocolTcpOptions () : this (nw_tcp_create_options (), owns: true) { }
public void SetNoDelay (bool noDelay) => nw_tcp_options_set_no_delay (GetCheckedHandle (), noDelay);
@ -87,11 +87,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
[DllImport (Constants.NetworkLibrary)]
static extern void nw_tcp_options_set_multipath_force_version (OS_nw_protocol_options options, NWMultipathVersion multipath_force_version);
@ -102,11 +102,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
public void ForceMultipathVersion (NWMultipathVersion version)
=> nw_tcp_options_set_multipath_force_version (GetCheckedHandle (), version);

Просмотреть файл

@ -16,8 +16,8 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using Security;
using OS_nw_protocol_definition=System.IntPtr;
using IntPtr=System.IntPtr;
using OS_nw_protocol_definition = System.IntPtr;
using IntPtr = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -31,16 +31,16 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWProtocolTlsOptions : NWProtocolOptions {
[Preserve (Conditional = true)]
internal NWProtocolTlsOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWProtocolTlsOptions (NativeHandle handle, bool owns) : base (handle, owns) { }
public NWProtocolTlsOptions () : this (nw_tls_create_options (), owns: true) {}
public NWProtocolTlsOptions () : this (nw_tls_create_options (), owns: true) { }
public SecProtocolOptions ProtocolOptions => new SecProtocolOptions (nw_tls_copy_sec_protocol_options (GetCheckedHandle ()), owns: true);
}

Просмотреть файл

@ -27,16 +27,16 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWProtocolUdpOptions : NWProtocolOptions {
[Preserve (Conditional = true)]
internal NWProtocolUdpOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWProtocolUdpOptions (NativeHandle handle, bool owns) : base (handle, owns) { }
public NWProtocolUdpOptions () : this (nw_udp_create_options (), owns: true) {}
public NWProtocolUdpOptions () : this (nw_udp_create_options (), owns: true) { }
public void SetPreferNoChecksum (bool preferNoChecksum) => nw_udp_options_set_prefer_no_checksum (GetCheckedHandle (), preferNoChecksum);
}

Просмотреть файл

@ -4,10 +4,10 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using nw_report_resolution_source_t=System.IntPtr;
using OS_nw_resolution_report=System.IntPtr;
using OS_nw_endpoint=System.IntPtr;
using nw_report_resolution_protocol_t=System.IntPtr;
using nw_report_resolution_source_t = System.IntPtr;
using OS_nw_resolution_report = System.IntPtr;
using OS_nw_endpoint = System.IntPtr;
using nw_report_resolution_protocol_t = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -23,16 +23,16 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
public class NWResolutionReport : NativeObject {
[Preserve (Conditional = true)]
internal NWResolutionReport (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWResolutionReport (NativeHandle handle, bool owns) : base (handle, owns) { }
[DllImport (Constants.NetworkLibrary)]
static extern NWReportResolutionSource nw_resolution_report_get_source (OS_nw_resolution_report resolutionReport);

Просмотреть файл

@ -7,8 +7,8 @@ using Foundation;
using ObjCRuntime;
using CoreFoundation;
using OS_nw_resolver_config=System.IntPtr;
using OS_nw_endpoint=System.IntPtr;
using OS_nw_resolver_config = System.IntPtr;
using OS_nw_endpoint = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -22,11 +22,11 @@ namespace Network {
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
[Watch (8, 0)]
[TV (15, 0)]
[Mac (12, 0)]
[iOS (15, 0)]
[MacCatalyst (15, 0)]
#endif
public class NWResolverConfig : NativeObject {
@ -34,7 +34,7 @@ namespace Network {
#if NET
internal NWResolverConfig (NativeHandle handle, bool owns) : base (handle, owns) {}
#else
public NWResolverConfig (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWResolverConfig (NativeHandle handle, bool owns) : base (handle, owns) { }
#endif
[DllImport (Constants.NetworkLibrary)]

Просмотреть файл

@ -26,15 +26,15 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWTcpMetadata : NWProtocolMetadata {
[Preserve (Conditional = true)]
internal NWTcpMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWTcpMetadata (NativeHandle handle, bool owns) : base (handle, owns) { }
public uint AvailableReceiveBuffer => nw_tcp_get_available_receive_buffer (GetCheckedHandle ());

Просмотреть файл

@ -27,15 +27,15 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWTlsMetadata : NWProtocolMetadata {
[Preserve (Conditional = true)]
internal NWTlsMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWTlsMetadata (NativeHandle handle, bool owns) : base (handle, owns) { }
public SecProtocolMetadata SecProtocolMetadata
=> new SecProtocolMetadata (nw_tls_copy_sec_protocol_metadata (GetCheckedHandle ()), owns: true);

Просмотреть файл

@ -17,9 +17,9 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using nw_advertise_descriptor_t=System.IntPtr;
using OS_nw_advertise_descriptor=System.IntPtr;
using OS_nw_txt_record=System.IntPtr;
using nw_advertise_descriptor_t = System.IntPtr;
using OS_nw_advertise_descriptor = System.IntPtr;
using OS_nw_txt_record = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -34,17 +34,17 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[Watch (6,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
[Watch (6, 0)]
#endif
public class NWTxtRecord : NativeObject {
[Preserve (Conditional = true)]
internal NWTxtRecord (NativeHandle handle, bool owns) : base (handle, owns) { }
[DllImport (Constants.NetworkLibrary)]
unsafe static extern IntPtr nw_txt_record_create_with_bytes (byte *txtBytes, nuint len);
unsafe static extern IntPtr nw_txt_record_create_with_bytes (byte* txtBytes, nuint len);
public static NWTxtRecord? FromBytes (ReadOnlySpan<byte> bytes)
{
@ -86,11 +86,12 @@ namespace Network {
{
unsafe {
fixed (byte* mh = value)
return nw_txt_record_set_key (GetCheckedHandle (), key, (IntPtr)mh, (nuint) value.Length) != 0;
return nw_txt_record_set_key (GetCheckedHandle (), key, (IntPtr) mh, (nuint) value.Length) != 0;
}
}
public bool Add (string key) {
public bool Add (string key)
{
unsafe {
return nw_txt_record_set_key (GetCheckedHandle (), key, IntPtr.Zero, 0) != 0;
}
@ -150,7 +151,7 @@ namespace Network {
if (del is null)
return false;
var mValue = new ReadOnlySpan<byte> ((void*)value, (int)valueLen);
var mValue = new ReadOnlySpan<byte> ((void*) value, (int) valueLen);
#if NET
return del (key, found, mValue);
#else
@ -216,7 +217,7 @@ namespace Network {
if (del is not null) {
ReadOnlySpan<byte> mValue;
if (found == NWTxtRecordFindKey.NonEmptyValue)
mValue = new ReadOnlySpan<byte>((void*)value, (int)valueLen);
mValue = new ReadOnlySpan<byte> ((void*) value, (int) valueLen);
else
mValue = Array.Empty<byte> ();
del (key, found, mValue);
@ -252,7 +253,7 @@ namespace Network {
{
var del = BlockLiteral.GetTarget<NWTxtRecordGetRawByteDelegate> (block);
if (del is not null) {
var mValue = new ReadOnlySpan<byte>((void*)value, (int)valueLen);
var mValue = new ReadOnlySpan<byte> ((void*) value, (int) valueLen);
del (mValue);
}
}

Просмотреть файл

@ -27,16 +27,16 @@ namespace Network {
[SupportedOSPlatform ("ios12.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (6,0)]
[TV (12, 0)]
[Mac (10, 14)]
[iOS (12, 0)]
[Watch (6, 0)]
#endif
public class NWUdpMetadata : NWProtocolMetadata {
[Preserve (Conditional = true)]
internal NWUdpMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWUdpMetadata (NativeHandle handle, bool owns) : base (handle, owns) { }
public NWUdpMetadata () : this (nw_udp_create_metadata (), owns: true) {}
public NWUdpMetadata () : this (nw_udp_create_metadata (), owns: true) { }
}
}

Просмотреть файл

@ -16,9 +16,9 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_protocol_metadata=System.IntPtr;
using OS_nw_ws_response=System.IntPtr;
using dispatch_queue_t =System.IntPtr;
using OS_nw_protocol_metadata = System.IntPtr;
using OS_nw_ws_response = System.IntPtr;
using dispatch_queue_t = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -32,20 +32,20 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[Watch (6,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
[Watch (6, 0)]
#endif
public class NWWebSocketMetadata : NWProtocolMetadata {
[Preserve (Conditional = true)]
internal NWWebSocketMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWWebSocketMetadata (NativeHandle handle, bool owns) : base (handle, owns) { }
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_protocol_metadata nw_ws_create_metadata (NWWebSocketOpCode opcode);
public NWWebSocketMetadata (NWWebSocketOpCode opcode) : this (nw_ws_create_metadata (opcode), owns: true) {}
public NWWebSocketMetadata (NWWebSocketOpCode opcode) : this (nw_ws_create_metadata (opcode), owns: true) { }
[DllImport (Constants.NetworkLibrary)]
static extern NWWebSocketCloseCode nw_ws_metadata_get_close_code (OS_nw_protocol_metadata metadata);
@ -74,7 +74,7 @@ namespace Network {
{
var del = BlockLiteral.GetTarget<Action<NWError?>> (block);
if (del is not null) {
var nwError = (error == IntPtr.Zero)? null : new NWError (error, owns: false);
var nwError = (error == IntPtr.Zero) ? null : new NWError (error, owns: false);
del (nwError);
}
}

Просмотреть файл

@ -16,8 +16,8 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_protocol_options=System.IntPtr;
using nw_ws_request_t=System.IntPtr;
using OS_nw_protocol_options = System.IntPtr;
using nw_ws_request_t = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -31,10 +31,10 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[Watch (6,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
[Watch (6, 0)]
#endif
public class NWWebSocketOptions : NWProtocolOptions {
bool autoReplyPing = false;
@ -42,7 +42,7 @@ namespace Network {
nuint maximumMessageSize;
[Preserve (Conditional = true)]
internal NWWebSocketOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWWebSocketOptions (NativeHandle handle, bool owns) : base (handle, owns) { }
[DllImport (Constants.NetworkLibrary)]
extern static IntPtr nw_ws_create_options (NWWebSocketVersion version);
@ -56,7 +56,7 @@ namespace Network {
{
if (header is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (header));
nw_ws_options_add_additional_header (GetCheckedHandle(), header, value);
nw_ws_options_add_additional_header (GetCheckedHandle (), header, value);
}
[DllImport (Constants.NetworkLibrary, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
@ -73,7 +73,7 @@ namespace Network {
static extern void nw_ws_options_set_auto_reply_ping (OS_nw_protocol_options options, [MarshalAs (UnmanagedType.I1)] bool auto_reply_ping);
public bool AutoReplyPing {
get { return autoReplyPing;}
get { return autoReplyPing; }
set {
autoReplyPing = value;
nw_ws_options_set_auto_reply_ping (GetCheckedHandle (), value);
@ -87,7 +87,7 @@ namespace Network {
get { return maximumMessageSize; }
set {
maximumMessageSize = value;
nw_ws_options_set_maximum_message_size (GetCheckedHandle(), value);
nw_ws_options_set_maximum_message_size (GetCheckedHandle (), value);
}
}

Просмотреть файл

@ -16,7 +16,7 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_ws_request=System.IntPtr;
using OS_nw_ws_request = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -30,14 +30,14 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[Watch (6,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
[Watch (6, 0)]
#endif
public class NWWebSocketRequest : NativeObject {
[Preserve (Conditional = true)]
internal NWWebSocketRequest (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWWebSocketRequest (NativeHandle handle, bool owns) : base (handle, owns) { }
[DllImport (Constants.NetworkLibrary)]
[return: MarshalAs (UnmanagedType.I1)]

Просмотреть файл

@ -16,7 +16,7 @@ using ObjCRuntime;
using Foundation;
using CoreFoundation;
using OS_nw_ws_response=System.IntPtr;
using OS_nw_ws_response = System.IntPtr;
#if !NET
using NativeHandle = System.IntPtr;
@ -30,15 +30,15 @@ namespace Network {
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("maccatalyst")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[Watch (6,0)]
[TV (13, 0)]
[Mac (10, 15)]
[iOS (13, 0)]
[Watch (6, 0)]
#endif
public class NWWebSocketResponse : NativeObject {
[Preserve (Conditional = true)]
internal NWWebSocketResponse (NativeHandle handle, bool owns) : base (handle, owns) {}
internal NWWebSocketResponse (NativeHandle handle, bool owns) : base (handle, owns) { }
[DllImport (Constants.NetworkLibrary, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
static extern unsafe OS_nw_ws_response nw_ws_response_create (NWWebSocketResponseStatus status, string selected_subprotocol);

Просмотреть файл

@ -2,7 +2,8 @@ using ObjCRuntime;
namespace NetworkExtension {
[iOS (8,0)][Mac (10,10)]
[iOS (8, 0)]
[Mac (10, 10)]
[ErrorDomain ("NEVPNErrorDomain")]
[Native]
public enum NEVpnError : long {
@ -14,7 +15,8 @@ namespace NetworkExtension {
ConfigurationUnknown = 6
}
[iOS (8,0)][Mac (10,10)]
[iOS (8, 0)]
[Mac (10, 10)]
[Native]
public enum NEVpnStatus : long {
Invalid = 0,
@ -25,7 +27,8 @@ namespace NetworkExtension {
Disconnecting = 5
}
[iOS (8,0)][Mac (10,10)]
[iOS (8, 0)]
[Mac (10, 10)]
[Native]
public enum NEVpnIkeAuthenticationMethod : long {
None = 0,
@ -33,22 +36,27 @@ namespace NetworkExtension {
SharedSecret = 2
}
[iOS (8,0)][Mac (10,10)]
[iOS (8, 0)]
[Mac (10, 10)]
[Native ("NEVPNIKEv2EncryptionAlgorithm")]
public enum NEVpnIke2EncryptionAlgorithm : long {
DES = 1,
TripleDES = 2,
AES128 = 3,
AES256 = 4,
[iOS (8,3)][Mac (10,11)]
[iOS (8, 3)]
[Mac (10, 11)]
AES128GCM = 5,
[iOS (8,3)][Mac (10,11)]
[iOS (8, 3)]
[Mac (10, 11)]
AES256GCM = 6,
[Mac (10,15)][iOS (13,0)]
[Mac (10, 15)]
[iOS (13, 0)]
ChaCha20Poly1305 = 7,
}
[iOS (8,0)][Mac (10,10)]
[iOS (8, 0)]
[Mac (10, 10)]
[Native ("NEVPNIKEv2IntegrityAlgorithm")]
public enum NEVpnIke2IntegrityAlgorithm : long {
SHA96 = 1,
@ -58,7 +66,8 @@ namespace NetworkExtension {
SHA512 = 5
}
[iOS (8,0)][Mac (10,10)]
[iOS (8, 0)]
[Mac (10, 10)]
[Native ("NEVPNIKEv2DeadPeerDetectionRate")]
public enum NEVpnIke2DeadPeerDetectionRate : long {
None = 0,
@ -67,7 +76,8 @@ namespace NetworkExtension {
High = 3
}
[iOS (8,0)][Mac (10,10)]
[iOS (8, 0)]
[Mac (10, 10)]
[Native ("NEVPNIKEv2DiffieHellmanGroup")]
public enum NEVpnIke2DiffieHellman : long {
Invalid = 0,
@ -83,11 +93,13 @@ namespace NetworkExtension {
Group19 = 19,
Group20 = 20,
Group21 = 21,
[Mac (10,15)][iOS (13,0)]
[Mac (10, 15)]
[iOS (13, 0)]
Group31 = 31,
}
[iOS (8,0)][Mac (10,10)]
[iOS (8, 0)]
[Mac (10, 10)]
[Native]
public enum NEOnDemandRuleAction : long {
Connect = 1,
@ -96,7 +108,8 @@ namespace NetworkExtension {
Ignore = 4
}
[iOS (8,0)][Mac (10,11)]
[iOS (8, 0)]
[Mac (10, 11)]
[Native]
public enum NEOnDemandRuleInterfaceType : long {
Any = 0,
@ -105,26 +118,29 @@ namespace NetworkExtension {
Cellular = 3
}
[iOS (8,0)][Mac (10,10)]
[iOS (8, 0)]
[Mac (10, 10)]
[Native]
public enum NEEvaluateConnectionRuleAction : long {
ConnectIfNeeded = 1,
NeverConnect = 2
}
[iOS (8,3)][Mac (10,11)]
[iOS (8, 3)]
[Mac (10, 11)]
[Native ("NEVPNIKEv2CertificateType")] // NSInteger
public enum NEVpnIke2CertificateType : long {
RSA = 1,
ECDSA256 = 2,
ECDSA384 = 3,
ECDSA521 = 4,
[Mac (10,15)][iOS (13,0)]
[Mac (10, 15)]
[iOS (13, 0)]
Ed25519 = 5,
}
// in Xcode7 SDK but marked as 8.0
[iOS (8,0)]
[iOS (8, 0)]
[ErrorDomain ("NEFilterErrorDomain")]
[Native]
public enum NEFilterManagerError : long {
@ -137,7 +153,7 @@ namespace NetworkExtension {
ConfigurationInternalError = 6,
}
[iOS (9,0)]
[iOS (9, 0)]
[ErrorDomain ("NETunnelProviderErrorDomain")]
[Native]
public enum NETunnelProviderError : long {
@ -147,7 +163,7 @@ namespace NetworkExtension {
Failed = 3
}
[iOS (9,0)]
[iOS (9, 0)]
[ErrorDomain ("NEAppProxyErrorDomain")]
[Native]
public enum NEAppProxyFlowError : long {
@ -165,10 +181,9 @@ namespace NetworkExtension {
ReadAlreadyPending = 10,
}
[iOS (9,0)]
[iOS (9, 0)]
[Native]
public enum NEProviderStopReason : long
{
public enum NEProviderStopReason : long {
None = 0,
UserInitiated = 1,
ProviderFailed = 2,
@ -184,26 +199,26 @@ namespace NetworkExtension {
UserLogout = 12,
UserSwitch = 13,
ConnectionFailed = 14,
[Mac (10,15)][iOS (13,0)]
[Mac (10, 15)]
[iOS (13, 0)]
Sleep = 15,
[Mac (10,15)][iOS (13,0)]
[Mac (10, 15)]
[iOS (13, 0)]
AppUpdate,
}
[iOS (9,0)]
[iOS (9, 0)]
[Native]
public enum NWPathStatus : long
{
public enum NWPathStatus : long {
Invalid = 0,
Satisfied = 1,
Unsatisfied = 2,
Satisfiable = 3
}
[iOS (9,0)]
[iOS (9, 0)]
[Native]
public enum NWTcpConnectionState : long
{
public enum NWTcpConnectionState : long {
Invalid = 0,
Connecting = 1,
Waiting = 2,
@ -212,10 +227,9 @@ namespace NetworkExtension {
Cancelled = 5
}
[iOS (9,0)]
[iOS (9, 0)]
[Native]
public enum NWUdpSessionState : long
{
public enum NWUdpSessionState : long {
Invalid = 0,
Waiting = 1,
Preparing = 2,
@ -224,18 +238,20 @@ namespace NetworkExtension {
Cancelled = 5
}
[iOS (9,0)][Mac (10,11)]
[iOS (9, 0)]
[Mac (10, 11)]
[Native]
public enum NETunnelProviderRoutingMethod : long {
DestinationIP = 1,
SourceApplication = 2,
[Mac (10,15)][NoiOS]
[Mac (10, 15)]
[NoiOS]
NetworkRule = 3,
}
#if !MONOMAC
[NoMac]
[iOS (9,0)]
[iOS (9, 0)]
[Native]
public enum NEHotspotHelperCommandType : long {
None = 0,
@ -248,7 +264,7 @@ namespace NetworkExtension {
}
[NoMac]
[iOS (9,0)]
[iOS (9, 0)]
[Native]
public enum NEHotspotHelperConfidence : long {
None = 0,
@ -257,7 +273,7 @@ namespace NetworkExtension {
}
[NoMac]
[iOS (9,0)]
[iOS (9, 0)]
[Native]
public enum NEHotspotHelperResult : long {
Success = 0,
@ -270,7 +286,7 @@ namespace NetworkExtension {
}
#endif
[NoWatch, NoTV, NoMac, iOS (14,0)]
[NoWatch, NoTV, NoMac, iOS (14, 0)]
[Native]
[ErrorDomain ("NEAppPushErrorDomain")]
public enum NEAppPushManagerError : long {
@ -280,7 +296,7 @@ namespace NetworkExtension {
InactiveSession = 4,
}
[NoWatch, NoTV, Mac (11,0), iOS (14,0)]
[NoWatch, NoTV, Mac (11, 0), iOS (14, 0)]
[Native ("NEDNSProtocol")]
public enum NEDnsProtocol : long {
Cleartext = 1,
@ -288,7 +304,7 @@ namespace NetworkExtension {
Https = 3,
}
[NoWatch, NoTV, Mac (11,0), iOS (14,0)]
[NoWatch, NoTV, Mac (11, 0), iOS (14, 0)]
[Native ("NEDNSSettingsManagerError")]
[ErrorDomain ("NEDNSSettingsErrorDomain")]
public enum NEDnsSettingsManagerError : long {

Просмотреть файл

@ -26,7 +26,7 @@ namespace NetworkExtension {
[UnsupportedOSPlatform ("macos")]
[UnsupportedOSPlatform ("tvos")]
#else
[iOS (13,0)]
[iOS (13, 0)]
#endif
public NEHotspotConfiguration (string ssid, bool ssidIsPrefix)
{
@ -40,7 +40,7 @@ namespace NetworkExtension {
[UnsupportedOSPlatform ("macos")]
[UnsupportedOSPlatform ("tvos")]
#else
[iOS (13,0)]
[iOS (13, 0)]
#endif
public NEHotspotConfiguration (string ssid, string passphrase, bool isWep, bool ssidIsPrefix)
{

Просмотреть файл

@ -9,8 +9,8 @@ namespace NetworkExtension {
public class NEHotspotHelperOptions : DictionaryContainer {
#if !COREBUILD
public NEHotspotHelperOptions () : base (new NSMutableDictionary ()) {}
public NEHotspotHelperOptions (NSDictionary dictionary) : base (dictionary) {}
public NEHotspotHelperOptions () : base (new NSMutableDictionary ()) { }
public NEHotspotHelperOptions (NSDictionary dictionary) : base (dictionary) { }
public NSString? DisplayName {
get {

Просмотреть файл

@ -14,8 +14,8 @@ namespace NetworkExtension {
public class NEVpnConnectionStartOptions : DictionaryContainer {
#if !COREBUILD
public NEVpnConnectionStartOptions () : base (new NSMutableDictionary ()) {}
public NEVpnConnectionStartOptions (NSDictionary dictionary) : base (dictionary) {}
public NEVpnConnectionStartOptions () : base (new NSMutableDictionary ()) { }
public NEVpnConnectionStartOptions (NSDictionary dictionary) : base (dictionary) { }
public NSString? Username {
get {

Просмотреть файл

@ -10,9 +10,10 @@ using UIKit;
namespace NotificationCenter {
[iOS (8,0)][Mac (10,10)]
[Deprecated (PlatformName.iOS, 14,0)]
[Deprecated (PlatformName.MacOSX, 11,0)]
[iOS (8, 0)]
[Mac (10, 10)]
[Deprecated (PlatformName.iOS, 14, 0)]
[Deprecated (PlatformName.MacOSX, 11, 0)]
[Native]
public enum NCUpdateResult : ulong {
NewData,
@ -20,8 +21,9 @@ namespace NotificationCenter {
Failed
}
[iOS (10,0)][NoMac]
[Deprecated (PlatformName.iOS, 14,0)]
[iOS (10, 0)]
[NoMac]
[Deprecated (PlatformName.iOS, 14, 0)]
[Native]
public enum NCWidgetDisplayMode : long {
Compact,

Просмотреть файл

@ -109,6 +109,9 @@ dotnet format whitespace --folder "$SRC_DIR/src/MediaAccessibility"
dotnet format whitespace --folder "$SRC_DIR/src/MediaLibrary"
dotnet format whitespace --folder "$SRC_DIR/src/MediaPlayer"
dotnet format whitespace --folder "$SRC_DIR/src/MediaToolbox"
dotnet format whitespace --folder "$SRC_DIR/src/Network"
dotnet format whitespace --folder "$SRC_DIR/src/NetworkExtension"
dotnet format whitespace --folder "$SRC_DIR/src/NotificationCenter"
dotnet format whitespace --folder "$SRC_DIR/src/SceneKit"
dotnet format whitespace --folder "$SRC_DIR/src/Security"
dotnet format whitespace --folder "$SRC_DIR/src/SensorKit"