سؤال

This isn't about "network programming" per say, but about how to handle the issue that arises when a client is running an application located on a server and the network connection goes down temporarily.

My background is in .Net. And my understanding is that if I run an application located on another machine, then the .exe from the remote machine is loaded into memory on the client machine... which means that, in .Net, I could catch an exception when the network goes down and handle it.

I don't know much about Clarion yet, but there is a Point Of Sale system I use that always crashes when the network goes down that's written in Clarion. The programmer assures me that when the network goes down that I am no longer connected to their application which resides on the server (I disagree with this because as mentioned before, I believe the application is already in memory on the client.)

Can this problem be handled in a Clarion application, and more importantly if so then how might you go about handling it?

EDIT: Also, I can see how there might be an issue if a particular dll that hasn't been loaded into memory yet is being accessed but for the purposes of this question assume that this isn't the case. I can make this issue happen virtually anytime I want by unplugging the network cable so I'm pretty confident that this isn't the issue (or at least not 99% of the time).

هل كانت مفيدة؟

المحلول

The application may be in memory on the client, but the data connection could be lost when the network fails. If that's not handled in code, the client could definitely crash. NetTalk, while fantastically robust, may not be what you're looking for in this situation.

After any Get, Set/Next, Add, Put, etc., you should be checking for errors:

Get(File, Key)
IF ErrorCode()
  !Show error message and ask to retry, etc.
  Message('Error '&ErrorCode()&' - '&Error())
End

You can also check FileError() which will give you more detailed information on file related errors.

نصائح أخرى

Yes, there is a nice Template set / Extension available at Capesoft.com, called NetTalk. I've written a lot of Net-centric Apps with that and it works perfectly. Examples show how to program a Webserver, Mailclient and so on. A lot of basic network functions will fit your needs, I think.

Have fun, Mick

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top