NDK_FN_ACCEPT_EX callback function (ndkpi.h)

The NdkAcceptEx (NDK_FN_ACCEPT_EX) function accepts an incoming connection request over a listener object.

Syntax

NDK_FN_ACCEPT_EX NdkFnAcceptEx;

NTSTATUS NdkFnAcceptEx(
  [in]                                      NDK_CONNECTOR *pNdkConnector,
  [in]                                      NDK_QP *pNdkQp,
  [in]                                      ULONG InboundReadLimit,
  [in]                                      ULONG OutboundReadLimit,
  [_In_reads_bytes_opt_(PrivateDataLength)] const PVOID pPrivateData,
  [in]                                      ULONG PrivateDataLength,
  [in, optional]                            NDK_FN_DISCONNECT_EVENT_CALLBACK_EX DisconnectEvent,
  [in, optional]                            PVOID DisconnectEventContext,
  [in]                                      NDK_FN_REQUEST_COMPLETION RequestCompletion,
  [in, optional]                            PVOID RequestContext
)
{...}

Parameters

[in] pNdkConnector

A pointer to an NDK connector object (NDK_CONNECTOR).

[in] pNdkQp

A pointer to an NDK queue pair (QP) object (NDK_QP) to associate with the connection.

[in] InboundReadLimit

The consumer-supplied maximum number of incoming in-progress read operations to allow on the QP. If the underlying provider has a lower MaxInboundReadLimit value in the NDK_ADAPTER_INFO structure, then the provider will cap the consumer-supplied value to the provider maximum. If the peer has a lower OutboundReadLimit value, then the provider will use that value as the effective InboundReadLimit. The consumer can retrieve the effective InboundReadLimit by calling the NdkGetConnectionData function (NDK_FN_GET_CONNECTION_DATA).

[in] OutboundReadLimit

The consumer-supplied maximum number of outgoing in-progress read operations to allow on the QP. If the underlying provider has a lower MaxOutboundReadLimit value in the NDK_ADAPTER_INFO structure, then the provider will cap the consumer supplied value to the provider maximum. If the peer has a lower InboundReadLimit, then the provider will use that value as the effective OutboundReadLimit. The consumer can retrieve the effective OutboundReadLimit by calling the NdkGetConnectionData function (NDK_FN_GET_CONNECTION_DATA).

[_In_reads_bytes_opt_(PrivateDataLength)] pPrivateData

Private data that is sent back with the accept request.

[in] PrivateDataLength

The length, in bytes, of the private data that is provided in the pPrivateData parameter.

[in, optional] DisconnectEvent

An entry point for an optional disconnect notification callback function NdkDisconnectEventCallbackEx NDK_FN_DISCONNECT_EVENT_CALLBACK_EX. The provider calls this callback function when the peer disconnects.

[in, optional] DisconnectEventContext

A context value to pass to the DisconnectEventContext parameter of the callback function that is specified in the DisconnectEvent parameter.

[in] RequestCompletion

A pointer to a request completion callback routine NdkRequestCompletion (NDK_FN_REQUEST_COMPLETION).

[in, optional] RequestContext

A context value to pass to the Context parameter of the callback function that is specified in the RequestCompletion parameter.

Return value

The NDK_FN_ACCEPT_EX function returns one of the following NTSTATUS codes.

Return code Description
STATUS_SUCCESS The operation completed successfully.
STATUS_PENDING The operation is pending and will be completed later. The driver will call the specified RequestCompletion (NDK_FN_REQUEST_COMPLETION) function to complete the pending operation.
STATUS_CONNECTION_ABORTED The connecting peer abandoned the pending connection establishment.
STATUS_IO_TIMEOUT The peer did not call the CompleteConnect (NDK_FN_COMPLETE_CONNECT_EX) function to complete the pending connection request.
Other status codes An error occurred.

Remarks

The NDK consumer calls NdkAcceptEx to accept an incoming connection request over a listener object.

The NdkCreateListener (NDK_FN_CREATE_LISTENER) function creates an NDK listener object and provides an NdkConnectEventCallback function (NDK_FN_CONNECT_EVENT_CALLBACK).

The NdkConnectEventCallback function is used by the NDK provider to notify the consumer about each incoming connection request.

Requirements

Requirement Value
Minimum supported client Supported in NDKPI 2.1 and later.
Minimum supported server Windows Server 2022
Target Platform Windows
Header ndkpi.h (include Ndkpi.h)
IRQL <=DISPATCH_LEVEL

See also

NDK_FN_DISCONNECT_EVENT_CALLBACK_EX

NDK_FN_COMPLETE_CONNECT_EX

NDKPI Object Lifetime Requirements

NDK_ADAPTER_INFO

NDK_CONNECTOR

NDK_CONNECTOR_DISPATCH

NDK_FN_CONNECT_EVENT_CALLBACK

NDK_FN_CREATE_LISTENER

NDK_FN_GET_CONNECTION_DATA

NDK_FN_REJECT

NDK_FN_REQUEST_COMPLETION

NDK_QP