Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Remember to include MVCFramework.pas and MVCFramework.Signal.pas
- procedure RunServer(APort: Integer);
- var
- LServer: TIdHTTPWebBrokerBridge;
- begin
- Writeln('** DMVCFramework Server ** build ' + DMVCFRAMEWORK_VERSION);
- LServer := TIdHTTPWebBrokerBridge.Create(nil);
- try
- LServer.OnParseAuthentication := TMVCParseAuthentication.OnParseAuthentication;
- LServer.DefaultPort := APort;
- LServer.KeepAlive := True;
- LServer.MaxConnections := 0;
- LServer.ListenQueue := 200;
- Writeln('Ctrl+C to exit');
- WaitForTerminationSignal;
- Write('Shutting down... ');
- EnterInShutdownState;
- WriteLn('OK');
- Write('Stop listening... ');
- LServer.StopListening;
- WriteLn('OK');
- finally
- LServer.Free;
- end;
- end;
Add Comment
Please, Sign In to add comment