Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

vipconnectwait.c File Reference

#include <stdlib.h>
#include <string.h>
#include "vipl_priv.h"

Go to the source code of this file.

Functions

VIP_ENTRY_POINT VIP_RETURN VipConnectWait (VIP_NIC_HANDLE NicHandle, VIP_NET_ADDRESS *LocalAddr, VIP_ULONG Timeout, VIP_NET_ADDRESS *RemoteAddr, VIP_VI_ATTRIBUTES *RemoteViAttribs, VIP_CONN_HANDLE *ConnHandle)


Detailed Description

The VI-GM function VipConnectWait implementation.

Definition in file vipconnectwait.c.


Function Documentation

VIP_ENTRY_POINT VIP_RETURN VipConnectWait VIP_NIC_HANDLE  NicHandle,
VIP_NET_ADDRESS LocalAddr,
VIP_ULONG  Timeout,
VIP_NET_ADDRESS RemoteAddr,
VIP_VI_ATTRIBUTES RemoteViAttribs,
VIP_CONN_HANDLE ConnHandle
 

VipConnectWait() is used to look for incoming connection requests on the server side of the client/server connection model. The caller passes in a local network address that is used to filter incoming connection requests. The format of the network address is VI Provider specific.

If a matching connection request is not found immediately, VipConnectWait() will wait for a request until the Timeout period has expired. If a connection request is found that matches the discriminator in the LocalAddress, the caller is returned the remote network address including the discriminator that is requesting a connection. The attributes of the remote endpoint that is requesting the connection and a connection handle to be used in subsequent calls to VipConnectAccept() or VipConnectReject() are also returned to the caller.

If the host portion of the LocalAddr parameter does not match the local NIC address (the LocalNicAddress field of the NicAttributes structure), then a VIP_INVALID_PARAMETER error is returned.

Return values:
VIP_SUCCESS The operation has successfully found a connection request.
VIP_TIMEOUT The operation timed out and no connection request was found.
VIP_ERROR_RESOURCE The operation failed due to a resource limit.
VIP_INVALID_PARAMETER One of the parameters was invalid.
Parameters:
NicHandle (IN) Handle for an instance of a VI NIC.
LocalAddr (IN) Local network address on which to wait. Only the discriminator portion of the net address is used to determine if the request matches. The host address portion must match the local NIC address.
Timeout (IN) The count, in milliseconds, that VipConnectWait() will wait to complete before returning to the caller. VIP_INFINITE if no time-out is desired. A timeout of zero indicates immediate return.
RemoteAddr (OUT) The remote network address (host address and discriminator) that is requesting a connection. The value of the network address returned is the same as the LocalAddr parameter supplied to the matching VipConnectRequest().
RemoteViAttribs (OUT) The attributes of the remote VI endpoint that is requesting the connection.
ConnHandle (OUT) A handle to an opaque connection object subsequently used in calls to VipConnectAccept() and VipConnectReject().
See also:
VipConnectRequest VipConnectAccept VipConnectReject VipDisconnect VIP_CONN
Author:
Patrick Geoffray
Version:
1.0

Definition at line 72 of file vipconnectwait.c.

References VIP_NET_ADDRESS::DiscriminatorLen, VIP_CONN::event, VIP_GM::head_waiting_conn_ptr, VIP_NET_ADDRESS::HostAddress, VIP_NET_ADDRESS::HostAddressLen, VIP_CONN::locale_disc_len, VIP_CONN::locale_net_addr, VIP_GM::lock, VIP_GM::mac_address, VIP_CONN::next_waiting_conn_ptr, VIP_CONN::prev_waiting_conn_ptr, VIP_CONN::status, VIP_GM::tail_waiting_conn_ptr, VIP_CONN::type, VI_GM_MAC_ADDRESS_LEN, VI_GM_MAX_DISCRIMINATOR_LEN, VIP_ABORT, vip_allocate_handle(), VIP_ASSERT, VIP_CONN_TYPE_SERVER, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_ERROR_RESOURCE, VIP_EVENT_INIT, vip_free_handle(), VIP_INVALID_NIC_HANDLE, VIP_INVALID_PARAMETER, vip_is_conn_notified(), VIP_MUTEX_LOCK, VIP_MUTEX_UNLOCK, VIP_NOT_DONE, VIP_PROGRESSION, vip_remove_conn_waiting_list(), VIP_SUCCESS, VIP_TIMEOUT, VIP_TRUE, VIP_CONN::vip_vi_ptr, vip_wait_for_notification(), and VIP_CONN::waiting_list.

VI-GM-1.3 by Myricom © 1997-2006. Documentation generated on 20 May 2006 by doxygen 1.4.4.