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

UPIPE_Connector.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    UPIPE_Connector.h
00006  *
00007  *  $Id: UPIPE_Connector.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Gerhard Lenzer and Douglas C. Schmidt
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef ACE_UPIPE_CONNECTOR_H
00015 #define ACE_UPIPE_CONNECTOR_H
00016 #include "ace/pre.h"
00017 
00018 #include "ace/UPIPE_Stream.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #include "ace/Synch.h"
00025 #include "ace/SPIPE_Stream.h"
00026 
00027 #if defined (ACE_HAS_THREADS)
00028 
00029 /**
00030  * @class ACE_UPIPE_Connector
00031  *
00032  * @brief Defines an active connection factory for the
00033  * ACE_UPIPE_STREAM wrappers.
00034  */
00035 class ACE_Export ACE_UPIPE_Connector
00036 {
00037 public:
00038   // = Initialization methods.
00039   /// Default constructor.
00040   ACE_UPIPE_Connector (void);
00041 
00042   /**
00043    * Actively connect and produce a @a new_stream if things go well.
00044    * The @a addr is the address that we are trying to connect
00045    * with.  The @a timeout is the amount of time to wait to connect.
00046    * If it's 0 then we block indefinitely.  If *timeout == {0, 0} then
00047    * the connection is done using non-blocking mode.  In this case, if
00048    * the connection can't be made immediately the value of -1 is
00049    * returned with <errno == EWOULDBLOCK>.  If *timeout > {0, 0} then
00050    * this is the maximum amount of time to wait before timing out.  If the
00051    * time expires before the connection is made <errno == ETIME>.  The
00052    * @a local_sap is the value of local address to bind to.  If it's
00053    * the default value of ACE_Addr::sap_any then the user is letting
00054    * the OS do the binding.  If @a reuse_addr == 1 then the
00055    * @a local_addr is reused, even if it hasn't been cleanedup yet.
00056    * The @a flags and @a perms arguments are passed down to the open()
00057    * method.
00058    */
00059   ACE_UPIPE_Connector (ACE_UPIPE_Stream &new_stream,
00060                        const ACE_UPIPE_Addr &addr,
00061                        ACE_Time_Value *timeout = 0,
00062                        const ACE_Addr &local_sap = ACE_Addr::sap_any,
00063                        int reuse_addr = 0,
00064                        int flags = O_RDWR,
00065                        int perms = 0);
00066 
00067   /**
00068    * Actively connect and produce a @a new_stream if things go well.
00069    * The @a addr is the address that we are trying to connect
00070    * with.  The @a timeout is the amount of time to wait to connect.
00071    * If it's 0 then we block indefinitely.  If *timeout == {0, 0} then
00072    * the connection is done using non-blocking mode.  In this case, if
00073    * the connection can't be made immediately the value of -1 is
00074    * returned with <errno == EWOULDBLOCK>.  If *timeout > {0, 0} then
00075    * this is the maximum amount of time to wait before timing out.  If the
00076    * time expires before the connection is made <errno == ETIME>.  The
00077    * @a local_sap is the value of local address to bind to.  If it's
00078    * the default value of ACE_Addr::sap_any then the user is letting
00079    * the OS do the binding.  If @a reuse_addr == 1 then the
00080    * @a local_addr is reused, even if it hasn't been cleanedup yet.
00081    * The @a flags and @a perms arguments are passed down to the open()
00082    * method.
00083    */
00084   int connect (ACE_UPIPE_Stream &new_stream,
00085                const ACE_UPIPE_Addr &addr,
00086                ACE_Time_Value *timeout = 0,
00087                const ACE_Addr &local_sap = ACE_Addr::sap_any,
00088                int reuse_addr = 0,
00089                int flags = O_RDWR,
00090                int perms = 0);
00091 
00092   /// Resets any event associations on this handle
00093   int reset_new_handle (ACE_HANDLE handle);
00094 
00095   // = Meta-type info
00096   typedef ACE_UPIPE_Addr PEER_ADDR;
00097   typedef ACE_UPIPE_Stream PEER_STREAM;
00098 
00099   /// Dump the state of an object.
00100   void dump (void) const;
00101 
00102   /// Declare the dynamic allocation hooks.
00103   ACE_ALLOC_HOOK_DECLARE;
00104 };
00105 
00106 #if !defined (ACE_LACKS_INLINE_FUNCTIONS)
00107 #include "ace/UPIPE_Connector.i"
00108 #endif
00109 
00110 #endif /* ACE_HAS_THREADS */
00111 #include "ace/post.h"
00112 #endif /* ACE_UPIPE_CONNECTOR_H */

Generated on Mon Jun 16 11:22:03 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002