Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to return binary data to web server from VFP using C
Message
De
05/04/2003 16:25:20
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00773698
Message ID:
00774474
Vues:
16
Claude, I try to use Apache 2 since:

1. It is open source and free.

2. It has three times more users than IIS. It is possible to get
more support for this.

3. In a typical company which uses linux firewall, it can run in linux firewall
computer and serve data from my vfp app from windows intranet using
file based communications like vfpcgi.

In my knowldege, there is no free asp implementation available for apache.

So I must use on of the following high-perf methods:

1. CGI - need to implement stdin/stdout access from vfp app.
2. foxisapi - this is mentonied in apache 2.0.45 readme file as working
but Rick wrote that this is not stable method in apache.
3. Creating a mt vfp isapi dll directly from my vfp app
4. use php or some other mt wrapper instead of asp to call my vfp mt dlls . Is this possible?

I prefer to use dlls or exe files, not com objects.

Which is the best way for Apache ?

>I rewrote that CGI exe into an isapi dll and it worked pretty good, but, the performance in high volume sites was pretty bad(the problem is the text files being passed around for communication). For me, VFP mtdlls called from ASP or ASP.net are the way to go. This is the premier Microsoft ISAPI implementation since ASp.dll and the ASp.net dll are just ISAPi extensions just like foxisapi. BTW, I thought it mentioned in the foxisapi notes that you could call vfp mtdlls, but, I've never seen this working or know if it's a good solution.
>>>Still at it building a home made solution, huh? <g>
>>
>>Yes. I desided to use VFP with Apache 2 CGI since this is the most dominant web server.
>>
>>To avoid fixing vfpcgi.exe bug on binary data, it may be possible to
>>call a vfp application exe instead of vfpcgi.exe
>>This increases the perfomance a lot since no timer polling is required.
>>(MS sample server.app has timer interval 250 MS. So it can process max 4 requests in a second).
>>
>>Are there some samples available on reading stdin and write to stdout from
>>VFP ? I remember this was discussed somewhere.
>>
>>I can create a very small vfp exe file for a cgi which is loaded fast.
>>Is may be possible to lock vfp dlls in memory so that they are not re-loaded.
>>
>>Since WWC cgi module is the same as MS mycgi.c, does it have the same bug by
>>discarding 0xOO bytes ?
>>Is it possible to appli some coding (base64) to output data so that binary
>>data is not sent ?
>>
>>About ISAPI:
>>
>>How to write a MT DLL in VFP 7 which can be used instead of FOXISAPI.dll
>>This may eliminate the foxisapi.dll call overhead in web server.
>>
>>>
>>>printf() doesn't handle CHR(0)'s as it sees it as a string terminator. You can use File output functions to write to StdOut as well such as WriteFile() API calls to which you can pass output, or fWrite() (you have to get the handle to StdOut for that first).
>>>
>>>You can write to StdOut from VFP using Windows API calls with CreateFile, WriteFile() and CloseHandle() ( I think ), but htis is a really bad idea as VFP is way too large to load up from scratch on every CGI hit.
>>>
>>>+++ Rick ---
>>>
>>>
>>>
>>>
>>>>I created a VFP 7 CGI application using vfpcgi which returs PDF files.
>>>>
>>>>I noticed that zero bytes (0x00) are not passed to web server.
>>>>
>>>>This is because mycgi.c shipped with vfp uses
>>>>
>>>>printf( "%s", buffer );
>>>>
>>>>to return data to web server . printf() stops writing if zero byte is
>>>>reached.
>>>>
>>>>It is possible to fix this by changing mycgi.c file and re-creating an exe
>>>>file.
>>>>
>>>>Unfortunately, I don't have Microsoft VC++ compiler required to
>>>>create vfpcgi.exe
>>>>
>>>>Can anybody create a correct vfpcgi.exe file or is there correct
>>>>vfpcgi module available somewhere ?
>>>>
>>>>Is it possible to read stdin and write to stdout from a VFP 7 application ?
>>>>This will eliminate the need of using vfpcgi.
Andrus
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform