Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Networking and Web Programming
»
How to terminate a THttpAplication?
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Problemas ao acessar o si...
by
pereira
[
Today
at 09:34:16 pm]
Checking for number or no...
by
Nimbus
[
Today
at 09:27:51 pm]
IDE tabs and spaces, auto...
by
Martin_fr
[
Today
at 09:23:30 pm]
Graphics32 installation e...
by
AndersM
[
Today
at 09:12:27 pm]
How to assign value to re...
by
MarkMLl
[
Today
at 08:50:09 pm]
Lazmapviewer: overlaying ...
by
MarkMLl
[
Today
at 07:29:30 pm]
Tcsvdataset issue
by
Packs
[
Today
at 05:38:15 pm]
[maybe SOLVED] BUG in Inp...
by
zeljko
[
Today
at 05:14:43 pm]
TPrintDialog disable Prop...
by
Zvoni
[
Today
at 04:19:29 pm]
Zebra printer and LazRepo...
by
tito_livio
[
Today
at 03:55:17 pm]
Cannot update a record us...
by
Zvoni
[
Today
at 02:39:34 pm]
Lazarus Release Candidate...
by
Martin_fr
[
Today
at 01:16:07 pm]
Move tab to other pagecon...
by
majid.ebru
[
Today
at 01:15:57 pm]
How to get and use the ma...
by
Hansaplast
[
Today
at 12:46:42 pm]
[Solved] DBEXPORT TFixedl...
by
Zvoni
[
Today
at 10:15:53 am]
NIL vs. Assign: when to u...
by
MarkMLl
[
Today
at 09:47:37 am]
Converting a Project from...
by
Zvoni
[
Today
at 08:11:37 am]
Uninstall
by
TRon
[
Today
at 03:56:15 am]
Using Bresenham's line al...
by
TBMan
[
Today
at 02:40:18 am]
[SOLVED] Remote access to...
by
wcage03
[
Today
at 02:12:39 am]
Hooking to `OnISupport` d...
by
Gustavo 'Gus' Carreno
[
Today
at 02:12:35 am]
Remote access to database...
by
wcage03
[
Today
at 12:48:40 am]
Program crashing with exc...
by
jamie
[March 19, 2025, 11:20:14 pm]
Form goes Frame - drag an...
by
Nicole
[March 19, 2025, 07:08:08 pm]
How to block mouse withou...
by
Yurgenz
[March 19, 2025, 06:45:54 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: How to terminate a THttpAplication? (Read 1183 times)
zen010101
Newbie
Posts: 5
How to terminate a THttpAplication?
«
on:
July 17, 2024, 07:54:44 pm »
My program wants to exit normally after Ctrl-C is pressed, but I haven't been able to accomplish this under FPC 3.22/3.3.1. The following is a sample program fragment from the official (...\fpcsrc\packages\fcl-web\examples\httpapp, I only added the code to respond to Ctrl-C)
Code: Pascal
[Select]
[+]
[-]
procedure
signalHandler
(
signum
:
cint
)
;
cdecl
;
begin
if
(
signum
=
SIGTERM
)
or
(
signum
=
SIGINT
)
then
begin
Writeln
(
'Exiting'
)
;
Application
.
Terminate
;
// can not quit the application
//Raise Exception.Create('EXIT THE APPLICATION'); // this can exit the THttpApplication normally, you will see 'Done' output to the console.
end
;
end
;
begin
// Register SignalHandler
fpSignal
(
SIGINT
,
@
signalHandler
)
;
.
.
.
Application
.
Initialize
;
Application
.
Port
:
=
StrTointDef
(
ParamStr
(
2
)
,
8384
)
;
Application
.
Title
:
=
'HTTP Demo application'
;
Application
.
Run
;
Writeln
(
'Done'
)
;
end
.
I noticed a bug report which was committed 4 years ago (
https://gitlab.com/freepascal.org/fpc/source/-/issues/36741#original-reporter-info-from-mantis-luca-olivlucareporter-name-luca-olivetti
), but until now it is still there too.
«
Last Edit: July 20, 2024, 07:59:52 pm by zen010101
»
Logged
PascalDragon
Hero Member
Posts: 5904
Compiler Developer
Re: How to terminate a THttpAplication?
«
Reply #1 on:
July 18, 2024, 09:31:03 pm »
Quote from: zen010101 on July 17, 2024, 07:54:44 pm
```pascal
[...]
```
The forum does not use Markdown, but BBCodes, in this case [code=pascal][/code].
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Networking and Web Programming
»
How to terminate a THttpAplication?
TinyPortal
© 2005-2018