Share via


INDEndpoint::Receive Method

Receives data from a peer.

Syntax

HRESULT Receive(
  [in]       ND_RESULT *pResult,
  [in, out]  ND_SGE *pSgl,
  [in]       SIZE_T nSge
);

Parameters

  • pResult [in]
    An ND_RESULT structure which will receive the status of the request. The status is set to one of the following status codes:

    ND_SUCCESS

    ND_BUFFER_OVERFLOW

    ND_ACCESS_VIOLATION

    ND_CANCELED

    ND_INVALID_REQUEST

    ND_FAILURE

    ND_TIMEOUT

    ND_REMOTE_ERROR

    ND_INVALIDATION_ERROR

pSgl [in, out]

A list of ND_SGE structures that will receive the data that the peer sends.

nSge [in]

The number of entries in the scatter/gather list. May be zero.

Return Value

When you implement this method, you should return the following return values. If you return others, try to use well-known values to aid in debugging issues.

Return code Description
ND_SUCCESS

The operation succeeded. Completion status will be returned through the outbound completion queue associated with the endpoint.

ND_BUFFER_OVERFLOW

The request referenced more data than is supported by the underlying hardware.

ND_NO_MORE_ENTRIES

The request would have exceeded the number of outbound requests allowed on this endpoint. The nOutboundEntries parameter of the INDConnector::CreateEndpoint method specifies the limit.

ND_DATA_OVERRUN

The number of scatter/gather entries in the scatter/gather list exceeded the number allowed on the endpoint. The nOutboundSge parameter of the INDConnector::CreateEndpoint method specifies the limit.

 

Remarks

You can call this method before the endpoint is connected. For example, you call this method before calling the INDAdapter::CreateMemoryWindow method to prepare for the peer calling the INDEndpoint::SendAndInvalidate method.

You must post a Receive request before the peer posts a Send request (or SendAndInvalidate). The buffers that you specify must be large enough to receive the sent data. If not, the Send request fails and the connection is terminated; the completion status for the Receive request is ND_BUFFER_OVERFLOW. If the receive request fails, the endpoint can still process existing or future requests.

The protocol determines how many Receive requests you must post and the buffer size that is required for each post.

Requirements

Product

Microsoft Message Passing Interface (MS-MPI)

Header

Ndspi.h

See Also

INDEndpoint

 

 

Send comments about this topic to Microsoft

Build date: 7/2/2010