Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Port Listener: VFP or C++ or ??
Message
De
06/11/2013 03:26:28
 
 
À
05/11/2013 17:19:37
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:
01587376
Vues:
73
>>>If you want high reliability on old computers, it's a good idea to have some sort of official protocol for evaluating them in case of problems e.g. check power incidents logged by UPS monitoring software, Windows Event logs, periodic dust vacuuming etc.
>
>In this case it's a VM on a Server2008 machine - but we've seen the freeze at more than one customer now.
>
>FWIW I've checked the code and can see one possible issue in the code downloaded from the VFP wiki- basically the message is added byte by byte into an object property which has to assign a new block of memory for the entire message as each byte is received rather than using textmerge or adding into a memo field. Some of these messages are large. Perhaps VFP is pushed to a garbage collection state mid-process so perhaps the accept times out or the termination character is mishandled so it waits forever. Certainly worth a refactor to use textmerge or memo.

re :is added byte by byte into an object property which has to assign a new block of memory for the entire message as each byte is received rather than using textmerge or adding into a memo field

For building strings, adding byte per byte

If it's an object property - it will start getting (very) slow as the string expands

There are some alternatives

(1) fcreate/fwrite/....

(2) HeapAlloc/HeapReAlloc/HeapFree together with sys(2600)

(3) Use an ado stream http://msdn.microsoft.com/en-us/library/ms675032(v=VS.85).aspx


or start with a property and switch to one of the above when its length reaches a certain size

If it's byte per byte, (1) is the fastest
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform