Revision: 6413
          http://playerstage.svn.sourceforge.net/playerstage/?rev=6413&view=rev
Author:   thjc
Date:     2008-05-10 15:10:54 -0700 (Sat, 10 May 2008)

Log Message:
-----------
some more work on passthrough runtime redirection

Modified Paths:
--------------
    code/player/branches/release-2-1-patches/server/drivers/shell/passthrough.cc

Modified: 
code/player/branches/release-2-1-patches/server/drivers/shell/passthrough.cc
===================================================================
--- 
code/player/branches/release-2-1-patches/server/drivers/shell/passthrough.cc    
    2008-05-10 10:33:22 UTC (rev 6412)
+++ 
code/player/branches/release-2-1-patches/server/drivers/shell/passthrough.cc    
    2008-05-10 22:10:54 UTC (rev 6413)
@@ -51,6 +51,8 @@
 The passthrough driver is also able to change its remote address at runtime. 
To do
 this set the connect property to 0, and then change as needed the remote_host, 
remote_port
 and remote_index properties. When you set connect to 1, it will connect to the 
new address.
+Setting connect to -1 will trigger a disconnect followed by a connect allowing 
for seamless
+transfer to a new remote device.
 
 Subscribed clients will have all requests nack'd while the driver is 
disconnected.
 
@@ -301,8 +303,24 @@
             return -1;
         if (strcmp("remote_index", req.key) == 0) 
             return -1;
-        if (strcmp("connect", req.key) == 0) 
+        if (strcmp("connect", req.key) == 0)
+        {
+            if (req.value == 0) // disconnect
+            {
+               DisconnectRemote();
+            }
+            else if (req.value == 1) // connect
+            {
+               ConnectRemote();
+            }
+            else if (req.value == -1) // reconnect (with new address if its 
changed)
+            {
+               DisconnectRemote();
+               ConnectRemote();
+            }
+               
             return -1;
+        }
     }
     
     // silence warning etc while we are not connected
@@ -396,13 +414,6 @@
     {
         InQueue->Wait();
         ProcessMessages();
-        if (Connect != Connected)
-        {
-            if (Connect)
-                ConnectRemote();
-            else
-               DisconnectRemote();
-        }
     }
 }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to