Język

SSLSocketFactory.CreateSocketAsync Method

Definition

Overloads

Name Description
CreateSocketAsync(Socket, String, Int32, Boolean)

Creates a socket connected to the given host and layered over an existing socket by running the synchronous method on the thread pool.

CreateSocketAsync()

Creates a new, unconnected SSL socket by running the synchronous method on the thread pool.

CreateSocketAsync(Socket, String, Int32, Boolean)

Creates a socket connected to the given host and layered over an existing socket by running the synchronous method on the thread pool.

public System.Threading.Tasks.Task<Java.Net.Socket?> CreateSocketAsync(Java.Net.Socket? socket, string? host, int port, bool autoClose);
member this.CreateSocketAsync : Java.Net.Socket * string * int * bool -> System.Threading.Tasks.Task<Java.Net.Socket>

Parameters

socket
Socket

The existing socket over which to create the SSL socket.

host
String

The host name or IP address.

port
Int32

The port on the host.

autoClose
Boolean

Whether to close socket when the created socket is closed.

Returns

A task whose result is the connected, layered socket returned by CreateSocket(Socket, String, Int32, Boolean).

Remarks

This .NET method uses Task.Run to call CreateSocket(Socket, String, Int32, Boolean) with the same arguments. It does not use native asynchronous socket I/O. The task preserves the synchronous method's return value, including null. If that method throws an exception, the task records the exception, which is rethrown when the task is awaited.

Source: .NET async method generator.

Portions of this page are based on work created and shared by the Apache Software Foundation and used under the terms of the Apache License, Version 2.0.

Applies to

CreateSocketAsync()

Creates a new, unconnected SSL socket by running the synchronous method on the thread pool.

public System.Threading.Tasks.Task<Java.Net.Socket?> CreateSocketAsync();
member this.CreateSocketAsync : unit -> System.Threading.Tasks.Task<Java.Net.Socket>

Returns

A task whose result is the new, unconnected SSL socket returned by CreateSocket().

Remarks

This .NET method uses Task.Run to call CreateSocket(). It does not use native asynchronous socket I/O. The task preserves the synchronous method's return value, including null. If that method throws an exception, the task records the exception, which is rethrown when the task is awaited.

Source: .NET async method generator.

Portions of this page are based on work created and shared by the Apache Software Foundation and used under the terms of the Apache License, Version 2.0.

Applies to