danieleteti

DMVCFramework :: MVCFramework.Signal (TEST)

Apr 1st, 2022 (edited)
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.76 KB | None | 0 0
  1. // Remember to include MVCFramework.pas and MVCFramework.Signal.pas
  2.  
  3. procedure RunServer(APort: Integer);
  4. var
  5.   LServer: TIdHTTPWebBrokerBridge;
  6. begin
  7.   Writeln('** DMVCFramework Server ** build ' + DMVCFRAMEWORK_VERSION);
  8.  
  9.   LServer := TIdHTTPWebBrokerBridge.Create(nil);
  10.   try
  11.     LServer.OnParseAuthentication := TMVCParseAuthentication.OnParseAuthentication;
  12.     LServer.DefaultPort := APort;
  13.     LServer.KeepAlive := True;
  14.     LServer.MaxConnections := 0;
  15.     LServer.ListenQueue := 200;
  16.  
  17.     Writeln('Ctrl+C to exit');
  18.     WaitForTerminationSignal;
  19.     Write('Shutting down...  ');
  20.     EnterInShutdownState;
  21.     WriteLn('OK');
  22.     Write('Stop listening... ');
  23.     LServer.StopListening;
  24.     WriteLn('OK');
  25.   finally
  26.     LServer.Free;
  27.   end;
  28. end;
Add Comment
Please, Sign In to add comment