View Full Version : Client & Server Communication
Elleah
05-25-2005, 10:56 PM
Hi,
I am currently doing an update program using the TU2. I am quite confused why does the window disappear after the client have checked from my server lists, I've just issue a screen.next action. It seems that when our server response quite long the screen disappear, then after that server will respond and will show the corresponding window. It's quite confusing for me and the user then, because I don't know if the Update is still running or not.
Is there any way I can eliminate this thing. How I can retain the window, while the client and server communication is in progress?
Please help.
Thanks.
Hi Elleah,
What is happening between the Screen.Next() action and the displaying of the next screen? Are you downloading the Server file or performing any other actions that may take a long time?
If this is the case you may think about performing these actions on a Progress Bar screen and handling the progress yourself. This way you can be assured that a screen will be displayed while these actions a being processed.
bnkrazy
05-26-2005, 11:35 AM
I was getting the same type of behavior because I do a lot of processing (more talking to server / downloading) between the time the internal update check / download runs and the first screen was displayed.
I did the same thing Mark suggested and it now runs beautifully with a nice progress indicator. Let me know if you would like to peek at my project and see how it was done.
The basic things I did to make it easy to implement this functionality were:
1) Break your scripts into managable sized functions. This makes it easy to alter the flow of the update later down the road as well.
2) Use the default Server Script to control the flow of the update, calling the broken out functions as needed.
When I saw what was happening, I simply moved the bulk of my flow control out of the Server Script and into a progress bar screen and added a few lines to update the progress bar at different points along the way. A very simple, elegant solution that now provides users with a more informative update process as well...bonus!
Elleah
05-26-2005, 09:19 PM
Hi to both of you,
I do modify the server script that was generated by the wizard, I am trying to read the file size of my update file in the server using the HTTP.GetFilesize in order to eliminate my variables. As I've used the StatusDlg.Show it informs me that I am connected to server and reading the update file. Maybe this cause me the delay then. Sample line in my code:
g_UpdateSize = HTTP.GetFileSize("http://www.ihgibp.com/tu2/"..g_UpdateFile, MODE_BINARY, 20, 80, nil, nil, nil);
Yes, can I get a peek on your project then.
Thanks,
Elleah
Hi Elleah,
Does the delay come before or after the status dialog is shown? If it comes before or after the status dialog (which I'm assuming wraps your HTTP.GetFileSize() action) then there may be other parts of your code that are causing the delay.
You could try wrapping more of your code with the Status dialog if you want, or moving it to different progress screens.
Elleah
05-29-2005, 08:34 PM
Hi Mark,
Actually what I've done to check if really the Getfilesize causes me the delay is to disabled the script and it seems that it really causes the delay.
So what I've done is to put it in a function that will be called only when necessary. I am planning to put in in a progress bar screen.
Thanks,
Elleah
Elleah
05-30-2005, 12:35 AM
Hi Mark,
I am just wondering how can I chenge the status Dialog title and text, because as I've used StatusDlg.SetTitle, it doesn't work...It didn't replace my status dialog title and even my status dialog text.
StatusDlg.Show(0, false);
StatusDlg.SetTitle("Please wait...");
The title appears to be "QUERYING THE INTERNET", which is not a descriptive one for the user.
What seems to be my problem?
Thanks,
Elleah
Hi Elleah,
The reason that the Status Dialog is using a different title then the one that you gave it is because you are letting TrueUpdate handle the status automatically. When TrueUpdate does that it sets everything on the Status Dialog: title, status text, progress position and so on. Take a look at the callback function topic in the help file for more information.
In order to control the title used on the status dialog you have two options:
1) Create your own callback function and handle the progress yourself. Take a look at the HTTP.GetFileSize() action in the help file for more information on the callback function.
2) Override the language message that TrueUpdate uses for the title text. Basically TrueUpdate is using the message MSG_QUERYING_INTERNET for the title text of the Status Dialog and you can override that message to be anything that you want. The only problem with this method is that the status dialog was designed to be multi-lingual so if your update is being run on a computer that is not an English system, and you change the title this way, the rest of the messages my be in another language with the title in English.
To change the value of messages use the following action: TrueUpdate.SetLocalizedString();
Elleah
05-31-2005, 01:08 AM
Hi Mark,
Yes I was already able to change the Status Dialog title yesterday by using the CallBackFunction as you've said. I am just wondering why I cannot really set the ProgressMeter. As I've check the HTTP.GetFileSize() Action, the CallbackFunction only returns a message and unlike the HTTP.Download() action where it returns the bytesread, filesize, transferrate...etc...so we can see the progress of the downloading. While in GetFileSize() I cannot set the Progressmeter at all because it only returns message, what I've done is I set the showprogressmeter to false and just tell the user that reading is in progress, but the actual percentage is not seen. Is there any way I can set the progressmeter of the statusdialog while it still doing the process?
Thanks,
Elleah
Hi Elleah,
The HTTP.GetFileSize() action does not have any progress meter progress because it generally does not take very long and it does not have progress in the same way that downloading or copying a file does.
The only thing that we could do is break up the internal stages that occur during an HTTP.GetFileSize() action and use that information as pseudo-progress. I entered this as a suggestion in our suggestion database.
You could do something similar to this, using your callback function you could break up the HTTP.GetFileSize() action up into parts based upon the status messages that you receive. Then when you receive the specific progress messages increase the progress by the required percent. You could also simply increase the progress meter every second so that it looks like something is happening and then set the progress meter to full before hiding the status dialog.
bnkrazy
06-02-2005, 06:12 PM
Sorry for the delay...I had an extended Memorial Day weekend and things were busy at work. If you are still interested in what I did, I attached a sterilized copy of my current-but-not-yet-completed project file. I assume all you need is the .tu2 file to view it, if not let me know.
Elleah
06-02-2005, 08:09 PM
Thanks a lot.
Regards,
Elleah
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.