NDK_FN_ACCEPT callback function

The NdkAccept (NDK_FN_ACCEPT) function accepts an incoming connection request over a listener object.

Syntax

NDK_FN_ACCEPT NdkFnAccept;

NTSTATUS NdkFnAccept(
  NDK_CONNECTOR *pNdkConnector,
  NDK_QP *pNdkQp,
  ULONG InboundReadLimit,
  ULONG OutboundReadLimit,
  const PVOID pPrivateData,
  ULONG PrivateDataLength,
  NDK_FN_DISCONNECT_EVENT_CALLBACK DisconnectEvent,
  PVOID DisconnectEventContext,
  NDK_FN_REQUEST_COMPLETION RequestCompletion,
  PVOID RequestContext
)
{...}

Parameters

*pNdkConnector

A pointer to an NDK connector object (NDK_CONNECTOR).

*pNdkQp

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

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).

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).

pPrivateData

PrivateDataLength

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

DisconnectEvent

An entry point for an optional disconnect notification callback function NdkDisconnectEventCallback (NDK_FN_DISCONNECT_EVENT_CALLBACK). The provider calls this callback function when the peer disconnects.

DisconnectEventContext

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

RequestCompletion

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

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 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) function to complete the pending connection request.
Other status codes
An error occurred.

Remarks

The NDK consumer calls NdkAccept 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

   
Minimum supported client None supported,Supported in NDIS 6.30 and later.
Minimum supported server Windows Server 2012
Target Platform Windows
Header ndkpi.h (include Ndkpi.h)
IRQL <=DISPATCH_LEVEL

See Also

NDKPI Object Lifetime Requirements

NDK_ADAPTER_INFO

NDK_CONNECTOR

NDK_CONNECTOR_DISPATCH

NDK_FN_COMPLETE_CONNECT

NDK_FN_CONNECT_EVENT_CALLBACK

NDK_FN_CREATE_LISTENER

NDK_FN_DISCONNECT_EVENT_CALLBACK

NDK_FN_GET_CONNECTION_DATA

NDK_FN_REJECT

NDK_FN_REQUEST_COMPLETION

NDK_QP