BeginConnect()

Socket::BeginConnect(System::SharedPtr<EndPoint>, AsyncCallback, System::SharedPtr<Object>) method

Initiates an asynchronous connect operation.

System::SharedPtr<IAsyncResult> System::Net::Sockets::Socket::BeginConnect(System::SharedPtr<EndPoint> remoteEP, AsyncCallback callback, System::SharedPtr<Object> state)

Arguments

ParameterTypeDescription
remoteEPSystem::SharedPtr<EndPoint>The remote endpoint.
callbackAsyncCallbackA callback that will be called when the operation completes.
stateSystem::SharedPtr<Object>User-provided data used to uniquely identify each asynchronous connect operation.

Return Value

An IAsyncResult object representing the initiated asynchronous connect operation.

Socket::BeginConnect(String, int32_t, AsyncCallback, System::SharedPtr<Object>) method

Initiates an asynchronous connect operation.

System::SharedPtr<IAsyncResult> System::Net::Sockets::Socket::BeginConnect(String host, int32_t port, AsyncCallback requestCallback, System::SharedPtr<Object> state)

Arguments

ParameterTypeDescription
hostStringThe remote host name.
portint32_tThe port number of the remote host.
requestCallbackAsyncCallbackA callback that will be called when the operation completes.
stateSystem::SharedPtr<Object>User-provided data used to uniquely identify each asynchronous connect operation.

Return Value

An IAsyncResult object representing the initiated asynchronous connect operation.

Socket::BeginConnect(System::SharedPtr<IPAddress>, int32_t, AsyncCallback, System::SharedPtr<Object>) method

Initiates an asynchronous connect operation.

System::SharedPtr<IAsyncResult> System::Net::Sockets::Socket::BeginConnect(System::SharedPtr<IPAddress> address, int32_t port, AsyncCallback requestCallback, System::SharedPtr<Object> state)

Arguments

ParameterTypeDescription
addressSystem::SharedPtr<IPAddress>The remote host IP address.
portint32_tThe port number of the remote host.
requestCallbackAsyncCallbackA callback that will be called when the operation completes.
stateSystem::SharedPtr<Object>User-provided data used to uniquely identify each asynchronous connect operation.

Return Value

An IAsyncResult object representing the initiated asynchronous connect operation.

Socket::BeginConnect(System::ArrayPtr<System::SharedPtr<IPAddress>>, int32_t, AsyncCallback, System::SharedPtr<Object>) method

Initiates an asynchronous connect operation.

System::SharedPtr<IAsyncResult> System::Net::Sockets::Socket::BeginConnect(System::ArrayPtr<System::SharedPtr<IPAddress>> addresses, int32_t port, AsyncCallback requestCallback, System::SharedPtr<Object> state)

Arguments

ParameterTypeDescription
addressesSystem::ArrayPtr<System::SharedPtr<IPAddress>>The IP addresses of the remote host.
portint32_tThe port number of the remote host.
requestCallbackAsyncCallbackA callback that will be called when the operation completes.
stateSystem::SharedPtr<Object>User-provided data used to uniquely identify each asynchronous connect operation.

Return Value

An IAsyncResult object representing the initiated asynchronous connect operation.

See Also