Updated to use FPC's servers (TCP and HTTP) implementation
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1782 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
1793c3f0f4
commit
d1ae85de1d
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<CONFIG>
|
<CONFIG>
|
||||||
<ProjectOptions>
|
<ProjectOptions>
|
||||||
|
<Version Value="9"/>
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<Version Value="7"/>
|
|
||||||
<General>
|
<General>
|
||||||
<Flags>
|
<Flags>
|
||||||
<MainUnitHasUsesSectionForAllUnits Value="False"/>
|
<MainUnitHasUsesSectionForAllUnits Value="False"/>
|
||||||
@ -12,11 +12,13 @@
|
|||||||
</Flags>
|
</Flags>
|
||||||
<SessionStorage Value="InProjectDir"/>
|
<SessionStorage Value="InProjectDir"/>
|
||||||
<MainUnit Value="0"/>
|
<MainUnit Value="0"/>
|
||||||
<TargetFileExt Value=".exe"/>
|
|
||||||
</General>
|
</General>
|
||||||
<VersionInfo>
|
<VersionInfo>
|
||||||
<ProjectVersion Value=""/>
|
<StringTable ProductVersion=""/>
|
||||||
</VersionInfo>
|
</VersionInfo>
|
||||||
|
<BuildModes Count="1">
|
||||||
|
<Item1 Name="default" Default="True"/>
|
||||||
|
</BuildModes>
|
||||||
<PublishOptions>
|
<PublishOptions>
|
||||||
<Version Value="2"/>
|
<Version Value="2"/>
|
||||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
@ -28,12 +30,7 @@
|
|||||||
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
||||||
</local>
|
</local>
|
||||||
</RunParams>
|
</RunParams>
|
||||||
<RequiredPackages Count="1">
|
<Units Count="2">
|
||||||
<Item1>
|
|
||||||
<PackageName Value="indylaz"/>
|
|
||||||
</Item1>
|
|
||||||
</RequiredPackages>
|
|
||||||
<Units Count="3">
|
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="http_server.pas"/>
|
<Filename Value="http_server.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
@ -44,27 +41,23 @@
|
|||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="user_service_intf"/>
|
<UnitName Value="user_service_intf"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
<Unit2>
|
|
||||||
<Filename Value="..\..\indy_tcp_server.pas"/>
|
|
||||||
<IsPartOfProject Value="True"/>
|
|
||||||
<UnitName Value="indy_tcp_server"/>
|
|
||||||
</Unit2>
|
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
<Version Value="8"/>
|
<Version Value="9"/>
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<Target>
|
<Target>
|
||||||
<Filename Value="http_server"/>
|
<Filename Value="http_server"/>
|
||||||
</Target>
|
</Target>
|
||||||
<SearchPaths>
|
<SearchPaths>
|
||||||
<IncludeFiles Value="..\..\"/>
|
<IncludeFiles Value="..\.."/>
|
||||||
<OtherUnitFiles Value="..\;..\..\;..\..\wst_rtti_filter\"/>
|
<OtherUnitFiles Value="..;..\..;..\..\wst_rtti_filter"/>
|
||||||
<UnitOutputDirectory Value="obj"/>
|
<UnitOutputDirectory Value="obj"/>
|
||||||
</SearchPaths>
|
</SearchPaths>
|
||||||
<Parsing>
|
<Parsing>
|
||||||
<SyntaxOptions>
|
<SyntaxOptions>
|
||||||
<IncludeAssertionCode Value="True"/>
|
<IncludeAssertionCode Value="True"/>
|
||||||
|
<UseAnsiStrings Value="False"/>
|
||||||
</SyntaxOptions>
|
</SyntaxOptions>
|
||||||
</Parsing>
|
</Parsing>
|
||||||
<Linking>
|
<Linking>
|
||||||
@ -74,10 +67,12 @@
|
|||||||
<LinkSmart Value="True"/>
|
<LinkSmart Value="True"/>
|
||||||
</Linking>
|
</Linking>
|
||||||
<Other>
|
<Other>
|
||||||
|
<CompilerMessages>
|
||||||
|
<UseMsgFile Value="True"/>
|
||||||
|
</CompilerMessages>
|
||||||
<CustomOptions Value="-dINDY_10
|
<CustomOptions Value="-dINDY_10
|
||||||
-dUseCThreads
|
-dUseCThreads
|
||||||
-dWST_DBG
|
-dWST_DBG"/>
|
||||||
"/>
|
|
||||||
<CompilerPath Value="$(CompPath)"/>
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
</Other>
|
</Other>
|
||||||
</CompilerOptions>
|
</CompilerOptions>
|
||||||
|
@ -1,13 +1,22 @@
|
|||||||
program http_server;
|
program http_server;
|
||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
|
{$IFDEF UNIX}
|
||||||
|
{$DEFINE UseCThreads}
|
||||||
|
{$DEFINE USE_THREAD}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IFDEF WINDOWS}
|
||||||
|
{$DEFINE USE_THREAD}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||||
cthreads,
|
cthreads,
|
||||||
{$ENDIF}{$ENDIF}
|
{$ENDIF}{$ENDIF}
|
||||||
Classes, SysUtils,
|
Classes, SysUtils,
|
||||||
indy_http_server, metadata_service, logger_extension, server_listener,
|
fpc_http_server, // indy_http_server,
|
||||||
|
metadata_service, logger_extension, server_listener,
|
||||||
server_service_soap, server_binary_formatter, server_service_xmlrpc, server_service_json, config_objects,
|
server_service_soap, server_binary_formatter, server_service_xmlrpc, server_service_json, config_objects,
|
||||||
user_service_intf, user_service_intf_binder, user_service_intf_imp, server_service_intf;
|
user_service_intf, user_service_intf_binder, user_service_intf_imp, server_service_intf;
|
||||||
|
|
||||||
@ -26,8 +35,12 @@ begin
|
|||||||
GetServiceImplementationRegistry().FindFactory('UserService').RegisterExtension(['TLoggerServiceExtension']);
|
GetServiceImplementationRegistry().FindFactory('UserService').RegisterExtension(['TLoggerServiceExtension']);
|
||||||
//wst_CreateDefaultFile(wst_GetConfigFileName(),nil);
|
//wst_CreateDefaultFile(wst_GetConfigFileName(),nil);
|
||||||
|
|
||||||
AppObject := TwstIndyHttpListener.Create('');
|
//AppObject := TwstIndyHttpListener.Create('');
|
||||||
|
AppObject := TwstFPHttpListener.Create('');
|
||||||
try
|
try
|
||||||
|
{$IFDEF USE_THREAD}
|
||||||
|
TwstFPHttpListener(AppObject).Options := [loExecuteInThread, loHandleRequestInThread];
|
||||||
|
{$ENDIF}
|
||||||
WriteLn('"Web Service Toolkit" HTTP Server sample listening at:');
|
WriteLn('"Web Service Toolkit" HTTP Server sample listening at:');
|
||||||
WriteLn('');
|
WriteLn('');
|
||||||
WriteLn('http://127.0.0.1:8000/');
|
WriteLn('http://127.0.0.1:8000/');
|
||||||
|
Loading…
Reference in New Issue
Block a user