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

SPIPE_Connector.h

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

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