Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Port Listener: VFP or C++ or ??
Message
De
06/11/2013 04:39:11
 
 
À
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:
01587386
Vues:
79
>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?

Winsock, properly used is reliable. This would be simple enough in .Net using either the Socket class which wraps Winsock or, in your case, maybe the higher level TcpClient class which is simpler to implement. In either case running within a windows service is also straightforward.

http://msdn.microsoft.com/en-us/library/system.net.sockets.socket(v=vs.110).aspx
http://msdn.microsoft.com/en-us/library/system.net.sockets.tcpclient(v=vs.110).aspx
http://msdn.microsoft.com/en-us/library/aa983583(v=vs.71).aspx

There's an old example here : http://www.codeproject.com/Articles/5733/A-TCP-IP-Server-written-in-C
In that instance the server is running as a service and receiving files from the client but the principle remains the same.....

HTH
>
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform