Hi Lailton,
thanks for your feedback!
Just to check – do I understand your setup correctly?
You're using CGI with Windows IIS, meaning:
The client sends an HTTP request (e.g. via fetch or form)
IIS starts a new process (your .exe application)
Request data is passed via STDIN or environment variables
Your app opens the DBF, performs some logic, returns output via STDOUT
IIS forwards this as the HTTP response
The process terminates
That’s a well-established and efficient setup – especially because IIS handles process creation and termination automatically.
In contrast, my current approach is based on WebSocket, and that brings one key architectural shift:
WebSocket (using Winsock) is part of the Windows operating system itself –
it doesn't require Apache, IIS, or any external HTTP server.
The .exe runs persistently as a standalone microservice
It opens a raw TCP socket (socket(), bind(), accept()) via Winsock
Clients communicate directly over WebSocket or fetch (via PHP proxy if needed)
DBF access is handled entirely in-memory
No startup delay – no process fork per request
No .req or .res temp files anymore
This allowed me to reduce the time for updating a single DBF field from ~135 ms to under 35 ms, while also eliminating the race conditions I had during parallel file access.
And just like CGI, the microservice can still start external .exe files if needed:
You can call a report generator
Trigger a background conversion tool
Or even run a Harbour or C program via CreateProcess() or ShellExecute()
So while the microservice is lean and persistent, it can delegate tasks like CGI – with full control over execution and return handling.
I think both models have their strengths.
CGI shines with its tight integration into the server.
WebSocket gives you full control at OS level – and makes it easy to build lightweight, event-driven architectures.
Best regards from Austria,
Otto
thanks for your feedback!
Just to check – do I understand your setup correctly?
You're using CGI with Windows IIS, meaning:
The client sends an HTTP request (e.g. via fetch or form)
IIS starts a new process (your .exe application)
Request data is passed via STDIN or environment variables
Your app opens the DBF, performs some logic, returns output via STDOUT
IIS forwards this as the HTTP response
The process terminates
That’s a well-established and efficient setup – especially because IIS handles process creation and termination automatically.
In contrast, my current approach is based on WebSocket, and that brings one key architectural shift:
WebSocket (using Winsock) is part of the Windows operating system itself –
it doesn't require Apache, IIS, or any external HTTP server.
The .exe runs persistently as a standalone microservice
It opens a raw TCP socket (socket(), bind(), accept()) via Winsock
Clients communicate directly over WebSocket or fetch (via PHP proxy if needed)
DBF access is handled entirely in-memory
No startup delay – no process fork per request
No .req or .res temp files anymore
This allowed me to reduce the time for updating a single DBF field from ~135 ms to under 35 ms, while also eliminating the race conditions I had during parallel file access.
And just like CGI, the microservice can still start external .exe files if needed:
You can call a report generator
Trigger a background conversion tool
Or even run a Harbour or C program via CreateProcess() or ShellExecute()
So while the microservice is lean and persistent, it can delegate tasks like CGI – with full control over execution and return handling.
I think both models have their strengths.
CGI shines with its tight integration into the server.
WebSocket gives you full control at OS level – and makes it easy to build lightweight, event-driven architectures.
Best regards from Austria,
Otto


