static void Main(string[] args) { CClientSocket.QueueConfigure.MessageQueuePassword = "******"; SetWorkDirectory(); ReplicationSetting rs = new ReplicationSetting(); using (CReplication <HelloWorld> hw = new CReplication <HelloWorld>(rs)) { Dictionary <string, CConnectionContext> ConnQueue = new Dictionary <string, CConnectionContext>(); CConnectionContext cc = new CConnectionContext("127.0.0.1", 20901, "replication", "p4localhost"); #if PocketPC #else ConnQueue["Tolocal"] = cc; #endif cc = new CConnectionContext("192.168.1.109", 20901, "remote_rep", "PassOne"); ConnQueue["ToLinux"] = cc; bool ok = hw.Start(ConnQueue, "hw_root_queue_name"); hw.StartJob(); ok = hw.Send(hwConst.idSayHelloHelloWorld, "David", "Young"); ok = hw.Send(hwConst.idEchoHelloWorld, CMyStruct.MakeOne()); hw.EndJob(); Console.WriteLine("Press key ENTER to shut down the application ......"); Console.ReadLine(); } }
static sqlpush() { CClientSocket.QueueConfigure.MessageQueuePassword = "******"; CClientSocket.QueueConfigure.WorkDirectory = "c:\\cyetest\\sqllog"; ReplicationSetting rs = new ReplicationSetting(); Dictionary<string, CConnectionContext> QNameConn = new Dictionary<string, CConnectionContext>(); CConnectionContext cc = new CConnectionContext("127.0.0.1", 20901, "SocketPro", "PassOne"); string []parts = Utilities.GetObjectParts(Utilities.GetDbFullName()); string qName = parts[2] + "_ToLocal"; QNameConn[qName] = cc; cc = new CConnectionContext("10.3.10.53", 20901, "SocketPro", "PassOne"); qName = parts[2] + "_ToLinux"; QNameConn[qName] = cc; m_hm = new CSqlReplication<MyAdo>(rs, QNameConn); }
static sqlpush() { CClientSocket.QueueConfigure.MessageQueuePassword = "******"; CClientSocket.QueueConfigure.WorkDirectory = "c:\\cyetest\\sqllog"; ReplicationSetting rs = new ReplicationSetting(); Dictionary <string, CConnectionContext> QNameConn = new Dictionary <string, CConnectionContext>(); CConnectionContext cc = new CConnectionContext("127.0.0.1", 20901, "SocketPro", "PassOne"); string [] parts = Utilities.GetObjectParts(Utilities.GetDbFullName()); string qName = parts[2] + "_ToLocal"; QNameConn[qName] = cc; cc = new CConnectionContext("10.3.10.53", 20901, "SocketPro", "PassOne"); qName = parts[2] + "_ToLinux"; QNameConn[qName] = cc; m_hm = new CSqlReplication <MyAdo>(rs, QNameConn); }
static void Main(string[] args) { CClientSocket.QueueConfigure.MessageQueuePassword = "******"; SetWorkDirectory(); ReplicationSetting rs = new ReplicationSetting(); using (CReplication<HelloWorld> hw = new CReplication<HelloWorld>(rs)) { Dictionary<string, CConnectionContext> ConnQueue = new Dictionary<string, CConnectionContext>(); CConnectionContext cc = new CConnectionContext("127.0.0.1", 20901, "replication", "p4localhost"); #if PocketPC #else ConnQueue["Tolocal"] = cc; #endif cc = new CConnectionContext("192.168.1.109", 20901, "remote_rep", "PassOne"); ConnQueue["ToLinux"] = cc; bool ok = hw.Start(ConnQueue, "hw_root_queue_name"); hw.StartJob(); ok = hw.Send(hwConst.idSayHelloHelloWorld, "David", "Young"); ok = hw.Send(hwConst.idEchoHelloWorld, CMyStruct.MakeOne()); hw.EndJob(); Console.WriteLine("Press key ENTER to shut down the application ......"); Console.ReadLine(); } }
/// <summary> /// Construct a CSqlReplication instance /// </summary> /// <param name="qms">A structure for setting its underlying socket pool and message queue directory as well as password for source queue</param> /// <param name="mapQueueConn">A dictionary for message queue name and connecting context. a unique name must be specified for each of connecting contexts</param> public CSqlReplication(ReplicationSetting qms, Dictionary <string, CConnectionContext> mapQueueConn) : base(qms) { string[] parts = Utilities.GetObjectParts(Utilities.GetDbFullName()); Start(mapQueueConn, parts[2] + "_qroot"); }
/// <summary> /// Construct a CSqlReplication instance /// </summary> /// <param name="qms">A structure for setting its underlying socket pool and message queue directory as well as password for source queue</param> public CSqlReplication(ReplicationSetting qms) : base(qms) { }