Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Handle_Ops Class Reference

#include <Handle_Ops.h>

Inheritance diagram for ACE_Handle_Ops:

Inheritance graph
[legend]
List of all members.

Static Public Methods

ACE_HANDLE handle_timed_open (ACE_Time_Value *timeout, const ACE_TCHAR *name, int flags, int perms, LPSECURITY_ATTRIBUTES sa=0)

Member Function Documentation

ACE_HANDLE ACE_Handle_Ops::handle_timed_open ACE_Time_Value   timeout,
const ACE_TCHAR   name,
int    flags,
int    perms,
LPSECURITY_ATTRIBUTES    sa = 0
[static]
 

Wait up to <timeout> amount of time to actively open a device. This method doesn't perform the <connect>, it just does the timed wait...

Definition at line 13 of file Handle_Ops.cpp.

References ACE_NONBLOCK, ACE_TCHAR, ACE_TRACE, ETIMEDOUT, EWOULDBLOCK, ACE_OS::open, ACE_Time_Value::sec, and ACE_Time_Value::usec.

Referenced by ACE_UPIPE_Connector::connect, ACE_SPIPE_Connector::connect, ACE_FILE_Connector::connect, and ACE_DEV_Connector::connect.

00018 {
00019   ACE_TRACE ("ACE_Handle_Ops::handle_timed_open");
00020 
00021   if (timeout != 0)
00022     {
00023 #if !defined (ACE_WIN32)
00024       // On Win32, ACE_NONBLOCK gets recognized as O_WRONLY so we
00025       // don't use it there
00026       flags |= ACE_NONBLOCK;
00027 #endif /* ACE_WIN32 */
00028 
00029       // Open the named pipe or file using non-blocking mode...
00030       ACE_HANDLE handle = ACE_OS::open (name,
00031                                         flags,
00032                                         perms,
00033                                         sa);
00034       if (handle == ACE_INVALID_HANDLE
00035           && (errno == EWOULDBLOCK
00036               && (timeout->sec () > 0 || timeout->usec () > 0)))
00037         // This expression checks if we were polling.
00038         errno = ETIMEDOUT;
00039 
00040       return handle;
00041     }
00042   else
00043     return ACE_OS::open (name, flags, perms, sa);
00044 }


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:48:19 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002