00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Name_Proxy.h 00006 * 00007 * Name_Proxy.h,v 4.13 2005/10/28 16:14:53 ossama Exp 00008 * 00009 * Proxy for dealing with remote server process managing NET_LOCAL 00010 * Name_Bindings. 00011 * 00012 * 00013 * @author Gerhard Lenzer 00014 * @author Douglas C. Schmidt 00015 * @author Prashant Jain 00016 */ 00017 //============================================================================= 00018 00019 00020 #ifndef ACE_NAME_PROXY_H 00021 #define ACE_NAME_PROXY_H 00022 #include /**/ "ace/pre.h" 00023 00024 #include "ace/INET_Addr.h" 00025 00026 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00027 # pragma once 00028 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00029 00030 #include "ace/SOCK_Connector.h" 00031 #include "ace/SOCK_Stream.h" 00032 #include "ace/Service_Config.h" 00033 #include "ace/Synch_Options.h" 00034 #include "ace/Name_Request_Reply.h" 00035 #include "ace/Event_Handler.h" 00036 00037 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00038 00039 /** 00040 * @class ACE_Name_Proxy 00041 * 00042 * @brief Proxy for dealing with remote server process managing NET_LOCAL 00043 * NameBindings. 00044 * 00045 * Shields applications from details of interacting with the 00046 * ACE_Name Server. 00047 */ 00048 class ACE_Export ACE_Name_Proxy : public ACE_Event_Handler 00049 { 00050 public: 00051 /// Default constructor. 00052 ACE_Name_Proxy (void); 00053 00054 // = Establish a binding with the ACE_Name Server. 00055 ACE_Name_Proxy (const ACE_INET_Addr &remote_addr, // Address of ACE_Name Server. 00056 ACE_Synch_Options& options = 00057 ACE_Synch_Options::defaults); 00058 00059 int open (const ACE_INET_Addr &remote_addr, // Address of ACE_Name Server. 00060 ACE_Synch_Options& options = 00061 ACE_Synch_Options::defaults); 00062 00063 /// Perform the request and wait for the reply. 00064 int request_reply (ACE_Name_Request &request); 00065 00066 /// Perform the request. 00067 int send_request (ACE_Name_Request &request); 00068 00069 /// Receive the reply. 00070 int recv_reply (ACE_Name_Request &reply); 00071 00072 /// Obtain underlying handle. 00073 virtual ACE_HANDLE get_handle (void) const; 00074 00075 /// Close down the connection to the server. 00076 virtual ~ACE_Name_Proxy (void); 00077 00078 /// Dump the state of the object; 00079 void dump (void) const; 00080 00081 private: 00082 00083 /// ACE_Connector factory used to establish connections actively. 00084 ACE_SOCK_Connector connector_; 00085 00086 /// Connection to ACE_Name Server peer. 00087 ACE_SOCK_Stream peer_; 00088 00089 /// Pointer to ACE_Reactor (used if we are run in "reactive-mode"). 00090 ACE_Reactor *reactor_; 00091 00092 private: 00093 // Prevent copying 00094 ACE_Name_Proxy (const ACE_Name_Proxy &); 00095 ACE_Name_Proxy &operator= (const ACE_Name_Proxy &); 00096 }; 00097 00098 ACE_END_VERSIONED_NAMESPACE_DECL 00099 00100 #include /**/ "ace/post.h" 00101 #endif /* ACE_NAME_PROXY_H */