Beispiel #1
0
 public FFRpc(string strName)
 {
     m_strServiceName = strName;
     m_strBrokerIP    = "127.0.0.1";
     m_nBrokerPort    = 43210;
     m_brokerData     = new RegisterToBrokerRet();
 }
Beispiel #2
0
 public FFBroker()
 {
     m_strListenHost = "tcp://127.0.0.1:43210";
     m_brokerData    = new RegisterToBrokerRet()
     {
         Node_id = 0, Register_flag = 0, Service2node_id = new Dictionary <string, long>()
     };
     m_dictSockets = new Dictionary <Int64 /* node id*/, IFFSocket>();
     m_nForAllocID = 0;
 }
Beispiel #3
0
 public FFRpc(string strName)
 {
     m_strServiceName = strName;
     m_strBrokerHost  = "tcp://127.0.0.1:43210";
     m_brokerData     = new RegisterToBrokerRet()
     {
         Node_id = 0, Register_flag = 0, Service2node_id = new Dictionary <string, long>()
     };
     m_dictFuncs    = new Dictionary <string /* msg name */, FFRpcFunc>();
     m_dictCallBack = new Dictionary <long, FFRpcFunc>();
     m_nIDGenerator = 0;
 }
Beispiel #4
0
 private void SyncNodeInfo(RegisterToBrokerRet retMsg, IFFSocket ffsocket)//! 同步给所有的节点,当前的各个节点的信息
 {
     //!广播给所有的子节点
     foreach (IFFSocket s in m_dictSockets.Values)
     {
         if (s == ffsocket)
         {
             retMsg.Register_flag = 1;
         }
         else
         {
             retMsg.Register_flag = 0;
         }
         FFNet.SendMsg(s, (UInt16)FFRPC_CMD.REGISTER_TO_BROKER_RET, retMsg);
     }
 }