07-25-2005 04:01 AM
07-26-2005 03:24 PM
I was unable to reproduce your issue using the explicit DataSocket Open VI's in conjunction with DataSocket Read and Write. I had two VI's, one writer and one reader, and they both open a connection, and then read or write in a loop. I was able to run the VI's, shut down the DataSocket server, and then restart the server, and have the VI's resume where they left off. In short, the DataSocket Read and Write VI's are able to reconnect after the DataSocket Server is restarted, even if they are explicitly opened before the loop using a DataSocket Open VI.
You mentioned that some of your connections were re-established, but not others. What is the qualitative difference between the two? Are some of these connections perhaps timing out before you restart the server?
09-11-2009 02:08 PM
Jarrod S. wrote:
Are some of these connections perhaps timing out before you restart the server?
And (if so)?
If the connection times out or if the datasocket read/write produces an error (due to connection loss for e.g.), and after "some" time (which is more than the time out, i.e. timed out too) if we restart the datasocket server, will it or will it not resume the same connection? I "used" string as datasocket connection name, and passed it in each datasocket read/write (so that I don't have to wire everywhere) and I'm now using ConnectionIDs instead of string (of the connection names) so if I restart datasocket server after a connection is lost, do I need to Re-open to reconnect or I can continue with the same connection id?
If I had connection strings in DS Read/Write nodes, it would (if necessary) open the connections first, but I thought the Connectin ID is something that is volatile (stays valid only for one life). If I am passing connectionID variables to DSRead/Write node and if the connection is reestablished at remote datasocket server, but not necessarily DS Opened in this VI, should it or should not it resume the "same" connections?
I thought it shouldn't. But to my surprise, it DOES.
I came to this thread in search of some answer, and while writing this response, I continued my experiment and it changed my belief. I started connections, then at one point I tried to write something to the DS address, after shutting down the server, and it gave an error naturally, which I handled and showed a message if the user wants to continue, and after 15 seconds (time out = 10 secs) I restarted DS server, and instantly it showed all those connections I had before I shut down, and I tried to write that data again (using ConnectionID) and it said OK in the Error Out.