aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/MessagingServer
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Grid/MessagingServer')
-rw-r--r--OpenSim/Grid/MessagingServer/MessageService.cs68
1 files changed, 43 insertions, 25 deletions
diff --git a/OpenSim/Grid/MessagingServer/MessageService.cs b/OpenSim/Grid/MessagingServer/MessageService.cs
index 0be58e3..5841672 100644
--- a/OpenSim/Grid/MessagingServer/MessageService.cs
+++ b/OpenSim/Grid/MessagingServer/MessageService.cs
@@ -518,22 +518,32 @@ namespace OpenSim.Grid.MessagingServer
518 ArrayList SendParams = new ArrayList(); 518 ArrayList SendParams = new ArrayList();
519 SendParams.Add(UserParams); 519 SendParams.Add(UserParams);
520 520
521 // Send Request 521 bool success = true;
522 try 522 string[] servers = m_cfg.UserServerURL.Split(' ');
523 {
524 XmlRpcRequest UserReq = new XmlRpcRequest("register_messageserver", SendParams);
525 XmlRpcResponse UserResp = UserReq.Send(m_cfg.UserServerURL, 16000);
526 523
527 // Process Response 524 foreach (string srv in servers)
528 Hashtable GridRespData = (Hashtable)UserResp.Value;
529 // if we got a response, we were successful
530 return GridRespData.ContainsKey("responsestring");
531 }
532 catch (Exception ex)
533 { 525 {
534 m_log.Error("Unable to connect to grid. User server not running?"); 526 // Send Request
535 throw(ex); 527 try
528 {
529 XmlRpcRequest UserReq = new XmlRpcRequest("register_messageserver", SendParams);
530 XmlRpcResponse UserResp = UserReq.Send(srv, 16000);
531
532 // Process Response
533 Hashtable GridRespData = (Hashtable)UserResp.Value;
534 // if we got a response, we were successful
535 if (!GridRespData.ContainsKey("responsestring"))
536 success = false;
537 else
538 m_log.InfoFormat("[SERVER] Registered with {0}", srv);
539 }
540 catch (Exception ex)
541 {
542 m_log.ErrorFormat("Unable to connect to server {0}. Server not running?", srv);
543 success = false;
544 }
536 } 545 }
546 return success;
537 } 547 }
538 548
539 public bool deregisterWithUserServer() 549 public bool deregisterWithUserServer()
@@ -557,21 +567,29 @@ namespace OpenSim.Grid.MessagingServer
557 ArrayList SendParams = new ArrayList(); 567 ArrayList SendParams = new ArrayList();
558 SendParams.Add(UserParams); 568 SendParams.Add(UserParams);
559 569
570 bool success = true;
571 string[] servers = m_cfg.UserServerURL.Split(' ');
572
560 // Send Request 573 // Send Request
561 try 574 foreach (string srv in servers)
562 {
563 XmlRpcRequest UserReq = new XmlRpcRequest("deregister_messageserver", SendParams);
564 XmlRpcResponse UserResp = UserReq.Send(m_cfg.UserServerURL, 16000);
565 // Process Response
566 Hashtable UserRespData = (Hashtable)UserResp.Value;
567 // if we got a response, we were successful
568 return UserRespData.ContainsKey("responsestring");
569 }
570 catch (Exception ex)
571 { 575 {
572 m_log.Error("Unable to connect to grid. User server not running?"); 576 try
573 throw (ex); 577 {
578 XmlRpcRequest UserReq = new XmlRpcRequest("deregister_messageserver", SendParams);
579 XmlRpcResponse UserResp = UserReq.Send(m_cfg.UserServerURL, 16000);
580 // Process Response
581 Hashtable UserRespData = (Hashtable)UserResp.Value;
582 // if we got a response, we were successful
583 if(!UserRespData.ContainsKey("responsestring"))
584 success = false;
585 }
586 catch (Exception ex)
587 {
588 m_log.Error("Unable to connect to grid. User server not running?");
589 success = false;
590 }
574 } 591 }
592 return success;
575 } 593 }
576 594
577 #endregion 595 #endregion