Recent

Author Topic: HTTP/2+HTTP/1.1+WebSocket server with Free Pascal  (Read 15036 times)

senglit

  • Full Member
  • ***
  • Posts: 112
Re: HTTP/2+HTTP/1.1+WebSocket server with Free Pascal
« Reply #15 on: January 13, 2022, 10:05:11 am »
hi,

when I tried to install it I got a error:oglregexprwrapper.pas(17,3) Fatal: Cannot find regexpr_t used by OGLRegExprWrapper of package commonutils_ilya2ik.
« Last Edit: January 13, 2022, 11:33:24 am by senglit »
I use Win10 + Lazarus 2.2.0 + FPC 3.2.2. All 64bit.

noszone

  • New Member
  • *
  • Posts: 33
Re: HTTP/2+HTTP/1.1+WebSocket server with Free Pascal
« Reply #16 on: January 13, 2022, 11:25:15 am »
Is your component fully supporting all major operaions? I mean is it safe to use it in live production project?

iLya2IK

  • New Member
  • *
  • Posts: 29
Re: HTTP/2+HTTP/1.1+WebSocket server with Free Pascal
« Reply #17 on: January 14, 2022, 01:11:00 pm »
hi,

when I tried to install it I got a error:oglregexprwrapper.pas(17,3) Fatal: Cannot find regexpr_t used by OGLRegExprWrapper of package commonutils_ilya2ik.

Hello.
The problem is caused by the fact that the current version of Lazarus uses an outdated RegExpr module. If your version of Lazarus already has REVersionMajor >= 1 in the RegExpr module, then it is correct to change two lines in module OGLRegExprWrapper:

Code: Pascal  [Select][+][-]
  1. {.$define regexpr_new}
  2. {$define regexpr_t}

to

Code: Pascal  [Select][+][-]
  1. {$define regexpr_new}
  2. {.$define regexpr_t}

Otherwise, it is strongly recommended to add all files from the folder "src" from repository https://github.com/andgineer/TRegExpr to the project folder or to the commonutils folder, and then rename regexpr.pas to regexpr_t.pas

If you do not want to download a new version of TRegExpr, you can limit yourself to the following change in OGLRegExprWrapper module
Code: Pascal  [Select][+][-]
  1. {.$define regexpr_new}
  2. {.$define regexpr_t}
« Last Edit: January 14, 2022, 03:51:51 pm by iLya2IK »

iLya2IK

  • New Member
  • *
  • Posts: 29
Re: HTTP/2+HTTP/1.1+WebSocket server with Free Pascal
« Reply #18 on: January 14, 2022, 01:45:39 pm »
Is your component fully supporting all major operaions? I mean is it safe to use it in live production project?

This product is just a convenient tool for realizing your specific needs - banking, shopping, streaming, etc. This server by itself cannot guarantee the security of transactions within your or any other external software - this product was not developed for this purpose. The business logic of such a live production project must be programmed by you yourself by, for example, connecting to a database management system with data replication, etc. Whereas WCHTTPServer will provide a platform and interface for your business logic to interact with the web. This product was developed by me for myself - to calculate engineering and scientific problems on a remote server. The server copes with this task regularly. Of course, it does not provide such a volume of features and a set of tools as many (non)commercial products, but in return it provides deep integration with the free pascal/lazarus development environment, reasonable query processing speed and ease of deployment on server hardware.

senglit

  • Full Member
  • ***
  • Posts: 112
Re: HTTP/2+HTTP/1.1+WebSocket server with Free Pascal
« Reply #19 on: January 21, 2022, 03:36:54 am »
It works! thank you!

hi,

when I tried to install it I got a error:oglregexprwrapper.pas(17,3) Fatal: Cannot find regexpr_t used by OGLRegExprWrapper of package commonutils_ilya2ik.

Hello.
The problem is caused by the fact that the current version of Lazarus uses an outdated RegExpr module. If your version of Lazarus already has REVersionMajor >= 1 in the RegExpr module, then it is correct to change two lines in module OGLRegExprWrapper:

Code: Pascal  [Select][+][-]
  1. {.$define regexpr_new}
  2. {$define regexpr_t}

to

Code: Pascal  [Select][+][-]
  1. {$define regexpr_new}
  2. {.$define regexpr_t}

Otherwise, it is strongly recommended to add all files from the folder "src" from repository https://github.com/andgineer/TRegExpr to the project folder or to the commonutils folder, and then rename regexpr.pas to regexpr_t.pas

If you do not want to download a new version of TRegExpr, you can limit yourself to the following change in OGLRegExprWrapper module
Code: Pascal  [Select][+][-]
  1. {.$define regexpr_new}
  2. {.$define regexpr_t}
I use Win10 + Lazarus 2.2.0 + FPC 3.2.2. All 64bit.

iLya2IK

  • New Member
  • *
  • Posts: 29
Re: HTTP/2+HTTP/1.1+WebSocket server with Free Pascal
« Reply #20 on: February 08, 2022, 12:51:26 pm »
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

  • Newbie
  • Posts: 3
Re: HTTP/2+HTTP/1.1+WebSocket server with Free Pascal
« Reply #21 on: June 16, 2022, 09:33:04 am »
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

  • New Member
  • *
  • Posts: 29
Re: HTTP/2+HTTP/1.1+WebSocket server with Free Pascal
« Reply #22 on: June 24, 2022, 07:01:53 am »
Congratulations for your excellent code!!

Thanks for your interest in my project  :)

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?

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).

 

TinyPortal © 2005-2018