Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Port Listener: VFP or C++ or ??
Message
De
06/11/2013 03:45:19
 
 
À
05/11/2013 16:08:12
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01587348
Message ID:
01587378
Vues:
115
>Looking for experienced advice re port listeners.
>
>We have customers whose Cloverleaf system relies on ports to communicate data messages to other systems, including ours.
>
>We have a small VFP app that uses Winsock to listen to the port. We used VFP because this thing may have to run on really old machines and it's great to be able to copy VFP exe and runtimes to a machine where you can be confident it will work immediately.
>
>When the app receives a message via the port, the app saves it into a folder and signals success. That's all it needs to do.
>
>Problem is that this port listener exe freezes. Then messages are dropped and we're in limbo until somebody notices and restarts it, at which point it runs fine until the next freeze.
>
>Does anybody have experience with port listening, e.g. via some other mechanism more reliable than Winsock?
>
>Also, as a related matter- ideally this app would run as a service so that if it fails it can shut down and be restarted automatically by Service Manager. But the developer says this does not happen, apparently because VFP lacks the "hooks" needed by Service Manager to oversee service availability. If the exe crashes or shuts down, apparently Service Manager thinks it's still working fine. I have reviewed Calvin's blogs and other material on this and see no reference to this issue. Is it true- IOW if a VFP service freezes or crashes out, does it really not get restarted by Service Manager? If so, does anybody have a better solution to work with port listening, or even if you confirm that you have VFP services doing other stuff under expected Service Manager control, iow restarting if required, that would be a great help.


You need to run a watchdog app on the same machine, one that is "pet" every so often, as by sending a message from the winsock app to the watchdog app every 30 seconds. If the watchdog isn't pet following a timeout interval or count, terminate and restart the winsock process. Pass the winsock app a -hwnd:N value on the command line it will use with SendMessage() to pet the watchdog. The watchdog can also be a vfp app, but it would probably be better to make it a C++ app because of vfp's threading model.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform