00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _terimber_msg_rpc_h_
00029 #define _terimber_msg_rpc_h_
00030
00031 #include "msg_conn.h"
00032 #include "msg_lsnr.h"
00033
00034 #if OS_TYPE == OS_WIN32
00035 #include <dce_port.h>
00036 #else
00037 #include <rpc/types.h>
00038 #endif
00039
00040 BEGIN_TERIMBER_NAMESPACE
00041 #pragma pack(4)
00042
00043
00046 class msg_rpc_connection : public msg_connection
00047 {
00048 public:
00050 msg_rpc_connection(msg_communicator* communicator_,
00051 rpc_binding_handle_t handle_,
00052 const conf_listener& linfo,
00053 const conf_connection& info
00054 );
00055
00057 msg_rpc_connection(msg_communicator* communicator_,
00058 rpc_binding_handle_t handle_,
00059 const conf_connection& info
00060 );
00061
00063 virtual
00064 ~msg_rpc_connection();
00066 static
00067 msg_connection*
00068 connect( msg_communicator* communicator_,
00069 const conf_connection& info
00070 );
00072 static
00073 void
00074 send_msg( msg_communicator* communicator_,
00075 msg_rpc_connection* _this,
00076 rpc_binding_handle_t handle_,
00077 msg_cpp* msg_
00078 );
00079 protected:
00081 virtual
00082 void
00083 v_do_job( size_t ident,
00084 void* user_data
00085 );
00086
00087 private:
00088 rpc_binding_handle_t _handle;
00089 };
00090
00093 class msg_rpc_listener : public msg_listener
00094 {
00097 typedef map< guid_t, msg_rpc_listener* > rpc_listener_map_t;
00098 public:
00100 msg_rpc_listener(msg_communicator* communicator_,
00101 const conf_listener& info_
00102 );
00104 virtual
00105 ~msg_rpc_listener();
00107 virtual
00108 transport_type
00109 get_type() const
00110 { return rpc; }
00111 protected:
00113 virtual void v_on();
00114 virtual void v_off();
00115 };
00116
00119 class msg_rpc_global
00120 {
00121 public:
00123 msg_rpc_global();
00125 ~msg_rpc_global();
00127 void
00128 init( size_t connections
00129 );
00130
00131 private:
00133 void
00134 _undo();
00135
00136 bool _done;
00137 bool _rpcStarter;
00138 };
00139
00140 #pragma pack()
00141 END_TERIMBER_NAMESPACE
00142
00143 #endif // _terimber_msg_rpc_h_
00144