INDAdapter::Listen Method

Creates a Listen object that listens for incoming connection requests.


  [in]             SIZE_T Backlog,
  [in]             int Protocol,
  [in]             USHORT Port,
  [out, optional]  USHORT *pAssignedPort,
  [out]            INDListen **ppListen


  • Backlog [in]
    The maximum number of pending connection requests to maintain for the listen request. Set to zero to indicate no limit.

  • Protocol [in]
    An IANA Internet Protocol number. Use the AF_INET and AF_INET6 constants to set this parameter.

    A client implementing TCP socket support over a Network Direct provider would use the TCP protocol number, 6. A client implementing UDP socket support over a Network Direct provider would use the UDP protocol number, 17. The underlying transport protocol, whether Ethernet or InfiniBand, is not relevant.

  • Port [in]
    The port number (in network byte order) within IANA protocol on which to listen. If zero, the Network Direct provider sets the pAssignedPort parameter to an available port.

  • pAssignedPort [out, optional]
    The port number (in network byte order) assigned by the provider. May be NULL if the Port parameter is non-zero.

  • ppListen [out]
    An INDListen interface that you use to listen for connection requests.

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

The operation completed successfully.


The protocol value is not valid.


The specified port is already in use on this Network Direct adapter instance. The instance was created when you called the INDProvider::OpenAdapter method.


The pAssignedPort cannot be NULL if the Port parameter is zero.


There were not enough resources to complete the request.


Implementation Notes

Network Direct providers may restrict the range of the backlog and silently apply limits. There is no provision for retrieving the actual backlog value.


The server-side of a client-server application listens for connection requests from the client-side.



Microsoft Message Passing Interface (MS-MPI)



See Also




Send comments about this topic to Microsoft

Build date: 7/2/2010