Forum > Third party

HTTP/2+HTTP/1.1+WebSocket server with Free Pascal

<< < (5/5)

iLya2IK:
Added a new example for WCHTTPServer.

REST Web Camera server

The server operates in the REST architecture mode. The server can accept POST requests and respond with JSON objects. The server is designed to collect images from cameras (devices) and forwards messages between devices to control the periphery via an HTTP 2 connection. A detailed implementation of an external device based on "ESP32-CAM" is given in the example webcamdevice. The example of a desktop application for external device controlling and viewing images is webcamclientviewer.

nicknikos:
iLya2IK,

Congratulations for your excellent code!!
I' m really interested in using your contributed code in an internal application for serving various terminals with database data.
One question though..After i ran the tests (hpec,hload) the cpu load on Windows 10 pro 64 kept high (100%).The same hapens when connections arrive to the server (tested in all forms http,restjson,webcamserver). What should one do release the cpu utilization?

Thanks in advance!!

iLya2IK:

--- Quote from: nicknikos on June 16, 2022, 09:33:04 am ---Congratulations for your excellent code!!

--- End quote ---

Thanks for your interest in my project  :)


--- Quote from: nicknikos on June 16, 2022, 09:33:04 am ---After i ran the tests (hpec,hload) the cpu load on Windows 10 pro 64 kept high (100%).The same hapens when connections arrive to the server (tested in all forms http,restjson,webcamserver). What should one do release the cpu utilization?

--- End quote ---

Yes. Thanks to you, I noticed this error in the operation of the server in a Windows environment. The fact is that I program mainly in a Linux environment, and I haven't tested a server under Windows for a long time. Now I have made the necessary adjustments to the code of the wcNetworking.pas module, which, in my opinion, significantly reduced the load on the cpu.

As for the wcNetworking.pas module - in the TThread.Execute method used the Sleep(0) call - in a Windows environment, this caused a serious increase in CPU load. Sleep(0) I changed to Sleep(1).

Navigation

[0] Message Index

[*] Previous page

Go to full version