diff --git a/delphizmq.bdsgroup b/delphizmq.bdsgroup index 3fbfb73..e584bda 100644 --- a/delphizmq.bdsgroup +++ b/delphizmq.bdsgroup @@ -8,9 +8,7 @@ - - - + tests\tests.bdsproj perf\local_lat.bdsproj perf\remote_lat.bdsproj @@ -18,45 +16,7 @@ perf\inproc_lat.bdsproj perf\inproc_thr.bdsproj perf\local_thr.bdsproj - examples\hwclient.bdsproj - examples\hwserver.bdsproj - examples\hwserverapi.bdsproj - examples\version.bdsproj - examples\wuserver.bdsproj - examples\wuclient.bdsproj - examples\taskvent.bdsproj - examples\taskwork.bdsproj - examples\tasksink.bdsproj - examples\msreader.bdsproj - examples\mspoller.bdsproj - examples\taskwork2.bdsproj - examples\tasksink2.bdsproj - examples\interrupt.bdsproj - examples\wuproxy.bdsproj - examples\rrclient.bdsproj - examples\rrserver.bdsproj - examples\rrbroker.bdsproj - examples\msgqueue.bdsproj - examples\mtserver.bdsproj - examples\mtrelay.bdsproj - examples\syncpub.bdsproj - examples\syncsub.bdsproj - examples\psenvpub.bdsproj - examples\psenvsub.bdsproj - examples\identity.bdsproj - examples\rtdealer.bdsproj - examples\rtmama.bdsproj - examples\rtpapa.bdsproj - examples\lruqueue.bdsproj - examples\lruqueue2.bdsproj - examples\asyncsrv.bdsproj - examples\peering1.bdsproj - examples\peering2.bdsproj - examples\lpclient.bdsproj - examples\lpserver.bdsproj - examples\spqueue.bdsproj - examples\spworker.bdsproj - tests.exe local_lat.exe remote_lat.exe remote_thr.exe inproc_lat.exe inproc_thr.exe local_thr.exe hwclient.exe hwserver.exe hwserverapi.exe version.exe wuserver.exe wuclient.exe taskvent.exe taskwork.exe tasksink.exe msreader.exe mspoller.exe taskwork2.exe tasksink2.exe interrupt.exe wuproxy.exe rrclient.exe rrserver.exe rrbroker.exe msgqueue.exe mtserver.exe mtrelay.exe syncpub.exe syncsub.exe psenvpub.exe psenvsub.exe identity.exe rtdealer.exe rtmama.exe rtpapa.exe lruqueue.exe lruqueue2.exe asyncsrv.exe peering1.exe peering2.exe lpclient.exe lpserver.exe spqueue.exe spworker.exe + tests.exe local_lat.exe remote_lat.exe remote_thr.exe inproc_lat.exe inproc_thr.exe local_thr.exe diff --git a/examples/asyncsrv.bdsproj b/examples/asyncsrv.bdsproj deleted file mode 100644 index 3448658..0000000 --- a/examples/asyncsrv.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - asyncsrv.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/asyncsrv.cfg b/examples/asyncsrv.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/asyncsrv.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/asyncsrv.dpr b/examples/asyncsrv.dpr deleted file mode 100644 index 4f18854..0000000 --- a/examples/asyncsrv.dpr +++ /dev/null @@ -1,158 +0,0 @@ -program asyncsrv; -// -// Asynchronous client-to-server (DEALER to ROUTER) -// -// While this example runs in a single process, that is just to make -// it easier to start and stop the example. Each task has its own -// context and conceptually acts as a separate process. - -{$APPTYPE CONSOLE} - -uses - SysUtils - , Classes - , zmqapi - ; - -// --------------------------------------------------------------------- -// This is our client task -// It connects to the server, and then sends a request once per second -// It collects responses as they arrive, and it prints them out. We will -// run several client tasks in parallel, each with a different random ID. - -procedure client_task( args: Pointer ); -var - ctx: TZMQContext; - client: TZMQSocket; - poller: TZMQPoller; - i, request_nbr: Integer; - msg: TZMQMsg; -begin - ctx := TZMQContext.create; - client := ctx.Socket( stDealer ); - - // Set random identity to make tracing easier - client.Identity := IntToHex( Integer(client), 8 ); - client.connect( 'tcp://localhost:5570' ); - - poller := TZMQPoller.Create( true ); - poller.register( client, [pePollIn] ); - - msg := nil; - request_nbr := 0; - while true do - begin - // Tick once per second, pulling in arriving messages - for i := 0 to 100 - 1 do - begin - poller.poll( 10 ); - if ( pePollIn in poller.PollItem[0].revents ) then - begin - client.recv( msg ); - ZMQNote( client.Identity + ': ' + msg.last.dump ); - msg.Free; - msg := nil; - end; - end; - request_nbr := request_nbr + 1; - client.send( Format('request #%d',[request_nbr]) ) - end; - - poller.Free; - ctx.Free; -end; - -// This is our server task. -// It uses the multithreaded server model to deal requests out to a pool -// of workers and route replies back to clients. One worker can handle -// one request at a time but one client can talk to multiple workers at -// once. - -procedure server_worker( args: Pointer ); forward; - -procedure server_task( args: Pointer ); -var - ctx: TZMQContext; - frontend, - backend: TZMQSocket; - i: Integer; - tid: Cardinal; -begin - ctx := TZMQContext.create; - - // Frontend socket talks to clients over TCP - frontend := ctx.Socket( stRouter ); - frontend.bind( 'tcp://*:5570' ); - - // Backend socket talks to workers over inproc - backend := ctx.Socket( stDealer ); - backend.bind( 'inproc://backend' ); - - // Launch pool of worker threads, precise number is not critical - for i := 0 to 4 do - BeginThread( nil, 0, @server_worker, ctx, 0, tid ); - - // Connect backend to frontend via a proxy - ZMQProxy( frontend, backend, nil ); - - ctx.Free; -end; - -// Each worker task works on one request at a time and sends a random number -// of replies back, with random delays between replies: - -procedure server_worker( args: Pointer ); -var - ctx: TZMQContext; - worker: TZMQSocket; - msg: TZMQMsg; - identity, - content: TZMQFrame; - i,replies: Integer; -begin - ctx := args; - worker := ctx.Socket( stDealer ); - worker.connect( 'inproc://backend' ); - msg := nil; - - while not ctx.Terminated do - begin - // The DEALER socket gives us the reply envelope and message - worker.recv( msg ); - identity := msg.pop; - content := msg.pop; - assert(content <> nil); - msg.Free; - msg := nil; - // Send 0..4 replies back - replies := Random( 5 ); - for i := 0 to replies - 1 do - begin - // Sleep for some fraction of a second - sleep( Random(1000) + 1 ); - msg := TZMQMsg.Create; - msg.add( identity.dup ); - msg.add( content.dup ); - worker.send( msg ); - end; - identity.Free; - content.Free; - end; -end; - -var - tid: Cardinal; -begin - // The main thread simply starts several clients, and a server, and then - // waits for the server to finish. - Randomize; - - BeginThread( nil, 0, @client_task, nil, 0, tid ); - BeginThread( nil, 0, @client_task, nil, 0, tid ); - BeginThread( nil, 0, @client_task, nil, 0, tid ); - BeginThread( nil, 0, @server_task, nil, 0, tid ); - - // Run for 5 seconds then quit - sleep( 5 * 1000 ); - -end. diff --git a/examples/hwclient.bdsproj b/examples/hwclient.bdsproj deleted file mode 100644 index ec59e7a..0000000 --- a/examples/hwclient.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - hwclient.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/hwclient.cfg b/examples/hwclient.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/hwclient.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/hwclient.dof b/examples/hwclient.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/hwclient.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/hwclient.dpr b/examples/hwclient.dpr deleted file mode 100644 index eb00ed3..0000000 --- a/examples/hwclient.dpr +++ /dev/null @@ -1,38 +0,0 @@ -program hwclient; -// -// Hello World client -// Connects REQ socket to tcp://localhost:5555 -// Sends "Hello" to server, expects "World" back -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -var - context: TZMQContext; - requester: TZMQSocket; - i: Integer; - sMsg: String; -begin - context := TZMQContext.Create; - - // Socket to talk to server - Writeln('Connecting to hello world server...'); - requester := Context.Socket( stReq ); - requester.connect( 'tcp://localhost:5555' ); - - for i := 0 to 9 do - begin - sMsg := 'Hello'; - Writeln( Format( 'Sending %s %d',[ sMsg, i ] )); - requester.send( sMsg ); - requester.recv( sMsg ); - Writeln( Format( 'Received %s %d', [ sMsg, i ] ) ); - end; - - requester.Free; - context.Free; -end. diff --git a/examples/hwclient.dproj b/examples/hwclient.dproj deleted file mode 100644 index a5b65ef..0000000 --- a/examples/hwclient.dproj +++ /dev/null @@ -1,139 +0,0 @@ - - - {6D704981-CE97-4EF1-8190-C39889A04BE5} - hwclient.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - ..\dcu - None - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1 - System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) - ..\;$(DCC_UnitSearchPath) - ..\bin - false - true - false - 1038 - false - false - - - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - true - - - None - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - VCLApplication - - - - hwclient.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/hwclient.res b/examples/hwclient.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/hwclient.res and /dev/null differ diff --git a/examples/hwserver.bdsproj b/examples/hwserver.bdsproj deleted file mode 100644 index 212a163..0000000 --- a/examples/hwserver.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - hwserver.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/hwserver.cfg b/examples/hwserver.cfg deleted file mode 100644 index 4b4484a..0000000 --- a/examples/hwserver.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O- --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/hwserver.dof b/examples/hwserver.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/hwserver.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/hwserver.dpr b/examples/hwserver.dpr deleted file mode 100644 index f410343..0000000 --- a/examples/hwserver.dpr +++ /dev/null @@ -1,63 +0,0 @@ -program hwserver; - -// -// Hello World server -// Binds REP socket to tcp://*:5555 -// Expects "Hello" from client, replies with "World" -// - -{$APPTYPE CONSOLE} - -{$I zmq.inc} -uses - SysUtils - , Windows - , zmq - ; - -var - context, - responder: Pointer; - - request, - reply: zmq_msg_t; - -begin - context := zmq_init(1); - - // Socket to talk to clients - responder := zmq_socket( context, ZMQ_REP ); - zmq_bind( responder, 'tcp://*:5555' ); - - while true do - begin - // Wait for next request from client - zmq_msg_init( request ); - {$ifdef zmq3} - zmq_recvmsg( responder, request, 0 ); - {$else} - zmq_recv( responder, request, 0 ); - {$endif} - Writeln( 'Received Hello' ); - zmq_msg_close( request ); - - // Do some 'work' - sleep( 1 ); - - // Send reply back to client - zmq_msg_init( reply ); - zmq_msg_init_size( reply, 5 ); - CopyMemory( zmq_msg_data( reply ), @'World'[1], 5 ); - {$ifdef zmq3} - zmq_sendmsg( responder, reply, 0 ); - {$else} - zmq_send( responder, reply, 0 ); - {$endif} - zmq_msg_close( reply ); - - end; - - // We never get here but if we did, this would be how we end - zmq_close( responder ); - zmq_term( context ); -end. diff --git a/examples/hwserver.dproj b/examples/hwserver.dproj deleted file mode 100644 index af52136..0000000 --- a/examples/hwserver.dproj +++ /dev/null @@ -1,141 +0,0 @@ - - - {CC44ADBC-EE97-4435-A016-702130744AE3} - hwserver.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - ..\dcu - None - 00400000 - vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7;$(DCC_UsePackage) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - ..\bin - System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) - false - ..\;$(DCC_UnitSearchPath) - false - true - false - false - 1 - 1038 - false - - - System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - true - - - None - ..\dcu - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - VCLApplication - - - - hwserver.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/hwserver.res b/examples/hwserver.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/hwserver.res and /dev/null differ diff --git a/examples/hwserverapi.bdsproj b/examples/hwserverapi.bdsproj deleted file mode 100644 index ab88a35..0000000 --- a/examples/hwserverapi.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - hwserverapi.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/hwserverapi.cfg b/examples/hwserverapi.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/hwserverapi.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/hwserverapi.dof b/examples/hwserverapi.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/hwserverapi.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/hwserverapi.dpr b/examples/hwserverapi.dpr deleted file mode 100644 index ae0f4e9..0000000 --- a/examples/hwserverapi.dpr +++ /dev/null @@ -1,38 +0,0 @@ -program hwserverapi; -// -// Hello World server in Delphi -// Binds REP socket to tcp://*:5555 -// Expects "Hello" from client, replies with "World" -// -{$APPTYPE CONSOLE} - -uses - SysUtils, - zmqapi; - -var - context: TZMQContext; - socket: TZMQSocket; - sMsg: String; - -begin - // Prepare our context and socket - context := TZMQContext.Create; - socket := context.Socket( stRep ); - socket.bind( 'tcp://*:5555' ); - - while true do - begin - // Wait for next request from client - socket.recv( sMsg ); - Writeln( Format( 'Received %s', [sMsg] ) ); - - // Do some 'work' - sleep( 1 ); - - // Send reply back to client - socket.send( 'World' ); - end; - socket.Free; - context.Free; -end. diff --git a/examples/hwserverapi.dproj b/examples/hwserverapi.dproj deleted file mode 100644 index 80eceff..0000000 --- a/examples/hwserverapi.dproj +++ /dev/null @@ -1,139 +0,0 @@ - - - {D090666B-1701-4393-8474-FC866E137857} - hwserverapi.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - ..\dcu - None - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1 - System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) - ..\;$(DCC_UnitSearchPath) - ..\bin - false - true - false - 1038 - false - false - - - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - true - - - None - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - VCLApplication - - - - hwserverapi.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/hwserverapi.res b/examples/hwserverapi.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/hwserverapi.res and /dev/null differ diff --git a/examples/identity.bdsproj b/examples/identity.bdsproj deleted file mode 100644 index aeec4a0..0000000 --- a/examples/identity.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - identity.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/identity.cfg b/examples/identity.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/identity.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/identity.dpr b/examples/identity.dpr deleted file mode 100644 index 01fc7ff..0000000 --- a/examples/identity.dpr +++ /dev/null @@ -1,44 +0,0 @@ -program identity; -// -// Demonstrate identities as used by the request-reply pattern. Run this -// program by itself. Note that the utility functions s_ are provided by -// zhelpers.h. It gets boring for everyone to keep repeating this code. -// - -{$APPTYPE CONSOLE} - -uses - Classes - , SysUtils - , zmqapi - ; -var context: TZMQContext; - sink - , anonymous - , identified: TZMQSocket; -begin - context := TZMQContext.create; - sink := context.Socket( stRouter ); - sink.bind( 'inproc://example' ); - - // First allow 0MQ to set the identity - anonymous := context.Socket( stReq ); - anonymous.connect( 'inproc://example' ); - anonymous.send( 'ROUTER uses a generated UUID' ); - - //sink.dump; [todo] - - // Then set the identity ourself - identified := context.Socket( stReq ); - identified.Identity := 'Hello'; - identified.connect( 'inproc://example' ); - identified.send( 'ROUTER socket uses REQ''s socket identity' ); - - //sink.dump; [todo] - - sink.Free; - anonymous.Free; - identified.Free; - context.Free; -end. - diff --git a/examples/interrupt.bdsproj b/examples/interrupt.bdsproj deleted file mode 100644 index 5d214d9..0000000 --- a/examples/interrupt.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - interrupt.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/interrupt.cfg b/examples/interrupt.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/interrupt.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/interrupt.dof b/examples/interrupt.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/interrupt.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/interrupt.dpr b/examples/interrupt.dpr deleted file mode 100644 index c508f75..0000000 --- a/examples/interrupt.dpr +++ /dev/null @@ -1,48 +0,0 @@ -program interrupt; -// -// Shows how to handle Ctrl-C -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -var - context: TZMQContext; - socket: TZMQSocket; - frame: TZMQFrame; - rc: Integer; - -begin -// IsMultiThread := True; - - context := TZMQContext.Create; - socket := Context.Socket( stRep ); - socket.bind( 'tcp://*:5555' ); - - while True do - begin - frame := TZMQFrame.Create; - try - socket.recv( frame ); - except - on e: EZMQException do - begin - Writeln('Exception: ' + e.Message ); - end; - end; - FreeAndNil( frame ); - - if socket.context.Terminated then - begin - Writeln( 'W: interrupt received, killing server...'); - break; - end; - - end; - socket.Free; - context.Free; - sleep(1000); -end. diff --git a/examples/interrupt.dproj b/examples/interrupt.dproj deleted file mode 100644 index 86a7302..0000000 --- a/examples/interrupt.dproj +++ /dev/null @@ -1,138 +0,0 @@ - - - {7BE9F4E4-5E53-410F-9571-8EBA41B90B3B} - interrupt.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1 - System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) - ..\;$(DCC_UnitSearchPath) - ..\bin - false - true - false - 1038 - false - false - - - System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - true - - - None - ..\dcu - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - - - - - interrupt.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/interrupt.res b/examples/interrupt.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/interrupt.res and /dev/null differ diff --git a/examples/lpclient.bdsproj b/examples/lpclient.bdsproj deleted file mode 100644 index d1ed592..0000000 --- a/examples/lpclient.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - lpclient.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/lpclient.cfg b/examples/lpclient.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/lpclient.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/lpclient.dpr b/examples/lpclient.dpr deleted file mode 100644 index b5322ab..0000000 --- a/examples/lpclient.dpr +++ /dev/null @@ -1,97 +0,0 @@ -program lpclient; -// -// Lazy Pirate client -// Use zmq_poll to do a safe request-reply -// To run, start lpserver and then randomly kill/restart it -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -const - REQUEST_TIMEOUT = 2500; // msecs, (> 1000!) - REQUEST_RETRIES = 3; // Before we abandon - SERVER_ENDPOINT = 'tcp://localhost:5555'; - -var - ctx: TZMQContext; - client: TZMQSocket; - sequence, - retries_left, - expect_reply: Integer; - request, - reply: String; - poller: TZMQPoller; -begin - ctx := TZMQContext.create; - Writeln( 'I: connecting to server...' ); - client := ctx.Socket( stReq ); - client.connect( SERVER_ENDPOINT ); - - poller := TZMQPoller.Create( true ); - poller.Register( client, [pePollIn] ); - - sequence := 0; - retries_left := REQUEST_RETRIES; - while ( retries_left > 0 ) and not ctx.Terminated do - begin - // We send a request, then we work to get a reply - inc( sequence ); - request := Format( '%d', [sequence] ); - client.send( request ); - - expect_reply := 1; - while ( expect_reply > 0 ) do - begin - // Poll socket for a reply, with timeout - poller.poll( REQUEST_TIMEOUT ); - - // Here we process a server reply and exit our loop if the - // reply is valid. If we didn't a reply we close the client - // socket and resend the request. We try a number of times - // before finally abandoning: - - if pePollIn in poller.PollItem[0].revents then - begin - // We got a reply from the server, must match sequence - client.recv( reply ); - if StrToInt( reply ) = sequence then - begin - Writeln( Format( 'I: server replied OK (%s)', [reply] ) ); - retries_left := REQUEST_RETRIES; - expect_reply := 0; - end else - Writeln( Format( 'E: malformed reply from server: %s', [ reply ] ) ); - - end else - begin - dec( retries_left ); - - if retries_left = 0 then - begin - Writeln( 'E: server seems to be offline, abandoning' ); - break; - end else - begin - Writeln( 'W: no response from server, retrying...' ); - // Old socket is confused; close it and open a new one - poller.Deregister( client, [pePollIn] ); - client.Linger := 0; - client.Free; - sleep(100); - Writeln( 'I: reconnecting to server...' ); - client := ctx.Socket( stReq ); - client.connect( SERVER_ENDPOINT ); - poller.Register( client, [pePollIn] ); - // Send request again, on new socket - client.send( request ); - end; - end; - end; - end; - poller.Free; - ctx.Free; -end. diff --git a/examples/lpserver.bdsproj b/examples/lpserver.bdsproj deleted file mode 100644 index 03cf43d..0000000 --- a/examples/lpserver.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - lpserver.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/lpserver.cfg b/examples/lpserver.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/lpserver.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/lpserver.dpr b/examples/lpserver.dpr deleted file mode 100644 index b353186..0000000 --- a/examples/lpserver.dpr +++ /dev/null @@ -1,52 +0,0 @@ -program lpserver; -// -// Lazy Pirate server -// Binds REQ socket to tcp://*:5555 -// Like hwserver except: -// - echoes request as-is -// - randomly runs slowly, or exits to simulate a crash. -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -var - context: TZMQContext; - server: TZMQSocket; - cycles: Integer; - request: String; -begin - Randomize; - - context := TZMQContext.create; - server := context.socket( stRep ); - server.bind( 'tcp://*:5555' ); - - cycles := 0; - while not context.Terminated do - begin - server.recv( request ); - inc( cycles ); - - // Simulate various problems, after a few cycles - if ( cycles > 3 ) and ( random(3) = 0) then - begin - Writeln( 'I: simulating a crash' ); - break; - end else - if ( cycles > 3 ) and ( random(3) = 0 ) then - begin - Writeln( 'I: simulating CPU overload' ); - sleep (2); - end; - - Writeln( Format( 'I: normal request (%s)', [request] ) ); - sleep (1); // Do some heavy work - server.send( request ); - end; - server.Free; - context.Free; -end. diff --git a/examples/lruqueue.bdsproj b/examples/lruqueue.bdsproj deleted file mode 100644 index e52f6b3..0000000 --- a/examples/lruqueue.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - lruqueue.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/lruqueue.cfg b/examples/lruqueue.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/lruqueue.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/lruqueue.dpr b/examples/lruqueue.dpr deleted file mode 100644 index 1e9fd8e..0000000 --- a/examples/lruqueue.dpr +++ /dev/null @@ -1,221 +0,0 @@ -program lruqueue; -// -// Least-recently used (LRU) queue device -// Clients and workers are shown here in-process -// - -{$APPTYPE CONSOLE} - -uses - Windows - , SysUtils - , zmqapi - ; - -const - NBR_CLIENTS = 10; - NBR_WORKERS = 3; - -// Basic request-reply client using REQ socket -// Since s_send and s_recv can't handle 0MQ binary identities we -// set a printable text identity to allow routing. -// -procedure client_task( args: Pointer ); -var - context: TZMQContext; - client: TZMQSocket; - reply: String; -begin - context := TZMQContext.create; - client := context.Socket( stReq ); - // Set a printable identity - client.Identity := IntToHex( Integer(client),8 ); - client.connect( 'tcp://127.0.0.1:5555' ); - - // Send request, get reply - client.send( 'HELLO' ); - client.recv( reply ); - ZMQNote( Format('Client: %s',[reply]) ); - - client.Free; - context.Free; -end; - -// While this example runs in a single process, that is just to make -// it easier to start and stop the example. Each thread has its own -// context and conceptually acts as a separate process. -// This is the worker task, using a REQ socket to do LRU routing. -// Since s_send and s_recv can't handle 0MQ binary identities we -// set a printable text identity to allow routing. - -procedure worker_task( args: Pointer ); -var - context: TZMQContext; - worker: TZMQSocket; - address - , empty - , request: String; -begin - context := TZMQContext.create; - worker := context.Socket( stReq ); - // Set a printable identity - worker.Identity := IntToHex( Integer(worker),8 ); - worker.connect( 'tcp://127.0.0.1:5556' ); - - // Tell broker we're ready for work - worker.send( 'READY' ); - - while true do - begin - // Read and save all frames until we get an empty frame - // In this example there is only 1 but it could be more - worker.recv( address ); - worker.recv( empty ); - Assert( empty = '' ); - - // Get request, send reply - worker.recv( request ); - ZMQNote( Format('Worker: %s',[request]) ); - - worker.send([ - address, - '', - 'OK' - ]); - end; - worker.Free; - context.Free; -end; - -// This is the main task. It starts the clients and workers, and then -// routes requests between the two layers. Workers signal READY when -// they start; after that we treat them as ready when they reply with -// a response back to a client. The LRU data structure is just a queue -// of next available workers. - -var - context: TZMQContext; - frontend - , backend: TZMQSocket; - i,j - , client_nbr: Integer; - tid: Cardinal; - - poller: TZMQPoller; - prc: Integer; - pr: TZMQPollItem; - - // Queue of available workers - available_workers: Integer = 0; - worker_queue: Array[0..9] of String; - worker_addr - , empty - , client_addr - , reply - , request: String; - -begin - // Prepare our context and sockets - context := TZMQContext.create; - frontend := context.Socket( stRouter ); - backend := context.Socket( stRouter ); - frontend.bind( 'tcp://127.0.0.1:5555' ); - backend.bind( 'tcp://127.0.0.1:5556' ); - - sleep(100); - - for i := 0 to NBR_CLIENTS - 1 do - BeginThread( nil, 0, @client_task, nil, 0, tid ); - client_nbr := NBR_CLIENTS; - - for i := 0 to NBR_WORKERS - 1 do - BeginThread( nil, 0, @worker_task, nil, 0, tid ); - - // Here is the main loop for the least-recently-used queue. It has two - // sockets; a frontend for clients and a backend for workers. It polls - // the backend in all cases, and polls the frontend only when there are - // one or more workers ready. This is a neat way to use 0MQ's own queues - // to hold messages we're not ready to process yet. When we get a client - // reply, we pop the next available worker, and send the request to it, - // including the originating client address. When a worker replies, we - // re-queue that worker, and we forward the reply to the original client, - // using the address envelope. - - poller := TZMQPoller.Create( true ); - poller.register( backend, [pePollIn] ); - poller.register( frontend, [pePollIn] ); - while client_nbr > 0 do - begin - - // Poll frontend only if we have available workers - if available_workers > 0 then - prc := poller.poll - else - prc := poller.poll( -1, 1 ); - - for i := 0 to prc - 1 do - begin - pr := poller.pollResult[i]; - - // Handle worker activity on backend - if ( pePollIn in pr.events ) and ( pr.socket = backend ) then - begin - // Queue worker address for LRU routing - backend.recv( worker_addr ); - Assert( available_workers < NBR_WORKERS ); - worker_queue[available_workers] := worker_addr; - inc( available_workers ); - - // Second frame is empty - backend.recv( empty ); - Assert( empty = '' ); - - // Third frame is READY or else a client reply address - backend.recv( client_addr ); - - // If client reply, send rest back to frontend - if client_addr <> 'READY' then - begin - backend.recv( empty ); - Assert( empty = '' ); - - backend.recv( reply ); - frontend.send([ - client_addr, - '', - reply - ]); - dec( client_nbr ); - end; - end else - // Here is how we handle a client request: - if ( pePollIn in pr.events ) and ( pr.socket = frontend ) then - begin - // Now get next client request, route to LRU worker - // Client request is [address][empty][request] - frontend.recv( client_addr ); - frontend.recv( empty ); - Assert( empty = '' ); - frontend.recv( request ); - - backend.send([ - worker_queue[0], - '', - client_addr, - '', - request - ]); - - // Dequeue and drop the next worker address - dec( available_workers ); - for j := 0 to available_workers - 1 do - worker_queue[j] := worker_queue[j+1]; - end; - end; - end; - poller.Free; - frontend.Free; - backend.Free; - context.Free; -end. - diff --git a/examples/lruqueue2.bdsproj b/examples/lruqueue2.bdsproj deleted file mode 100644 index f8a814f..0000000 --- a/examples/lruqueue2.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - lruqueue2.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/lruqueue2.cfg b/examples/lruqueue2.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/lruqueue2.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/lruqueue2.dpr b/examples/lruqueue2.dpr deleted file mode 100644 index ef6ab9e..0000000 --- a/examples/lruqueue2.dpr +++ /dev/null @@ -1,168 +0,0 @@ -program lruqueue2; -// -// Least-recently used (LRU) queue device -// Demonstrates use of the Higher level API -// - -{$APPTYPE CONSOLE} - -uses - Windows - , SysUtils - , Classes - , zmqapi - ; - -const - NBR_CLIENTS = 10; - NBR_WORKERS = 3; - LRU_READY = '\001'; // Signals worker is ready - -// Basic request-reply client using REQ socket -procedure client_task( args: Pointer ); -var - context: TZMQContext; - client: TZMQSocket; - reply: String; -begin - context := TZMQContext.create; - client := context.Socket( stReq ); - client.connect( 'tcp://127.0.0.1:5555' ); - - // Send request, get reply - while not context.Terminated do - begin - client.send( 'HELLO' ); - client.recv( reply ); - ZMQNote( Format('Client: %s',[reply]) ); - sleep(1); - end; - context.Free; -end; - -// Worker using REQ socket to do LRU routing -// -procedure worker_task( args: Pointer ); -var - context: TZMQContext; - worker: TZMQSocket; - msg: TStringList; -begin - context := TZMQContext.create; - worker := context.Socket( stReq ); - // Set a printable identity - worker.Identity := IntToHex( Integer(worker),8 ); - - worker.connect( 'tcp://127.0.0.1:5556' ); - msg := TStringList.Create; - // Tell broker we're ready for work - worker.send( LRU_READY ); - - // Process messages as they arrive - while not context.Terminated do - begin - msg.Clear; - worker.recv( msg ); - //ZMQNote( Format('Worker: %s',[msg[2]]) ); - msg[2] := 'OK'; - worker.send( msg ); - end; - msg.Free; - context.Free; -end; - -// Now we come to the main task. This has the identical functionality to -// the previous lruqueue example but uses the Higher level API to start child -// threads, to hold the list of workers, and to read and send messages: - -var - context: TZMQContext; - frontend - , backend: TZMQSocket; - i,j: Integer; - tid: Cardinal; - - poller: TZMQPoller; - prc: Integer; - pr: TZMQPollItem; - - // Queue of available workers - worker_queue: TStringList; - msg: TStringList; - -begin - - // Prepare our context and sockets - context := TZMQContext.create; - frontend := context.Socket( stRouter ); - backend := context.Socket( stRouter ); - frontend.bind( 'tcp://127.0.0.1:5555' ); - backend.bind( 'tcp://127.0.0.1:5556' ); - - sleep(100); - - for i := 0 to NBR_CLIENTS - 1 do - BeginThread( nil, 0, @client_task, nil, 0, tid ); - - for i := 0 to NBR_WORKERS - 1 do - BeginThread( nil, 0, @worker_task, nil, 0, tid ); - - msg := TStringList.create; - worker_queue := TStringList.Create; - poller := TZMQPoller.Create( true ); - poller.register( backend, [pePollIn] ); - poller.register( frontend, [pePollIn] ); - - while not context.Terminated do - begin - - // Poll frontend only if we have available workers - if worker_queue.Count > 0 then - prc := poller.poll - else - prc := poller.poll( -1, 1 ); - - for i := 0 to prc - 1 do - begin - pr := poller.pollResult[i]; - msg.clear; - // Handle worker activity on backend - if ( pePollIn in pr.events ) and ( pr.socket = backend ) then - begin - backend.recv( msg ); - Assert( worker_queue.Count < NBR_WORKERS ); - worker_queue.Add( msg[0] ); - Assert( msg[1] = '' ); - - // If client reply, send rest back to frontend - if msg[2] <> LRU_READY then - begin - Assert( msg[3] = '' ); - msg.Delete(0); - msg.Delete(0); - frontend.send( msg ); - end; - end else - // Here is how we handle a client request: - if ( pePollIn in pr.events ) and ( pr.socket = frontend ) then - begin - // Now get next client request, route to LRU worker - // Client request is [address][empty][request] - frontend.recv( msg ); - Assert( msg[1] = '' ); - msg.Insert(0,''); - msg.Insert(0,worker_queue[0]); - - backend.send(msg); - - // Dequeue and drop the next worker address - worker_queue.Delete( 0 ); - end; - end; - end; - msg.Free; - worker_queue.Free; - poller.Free; - context.Free; -end. - diff --git a/examples/msgqueue.bdsproj b/examples/msgqueue.bdsproj deleted file mode 100644 index ed5829c..0000000 --- a/examples/msgqueue.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - msgqueue.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/msgqueue.cfg b/examples/msgqueue.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/msgqueue.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/msgqueue.dof b/examples/msgqueue.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/msgqueue.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/msgqueue.dpr b/examples/msgqueue.dpr deleted file mode 100644 index c806ff0..0000000 --- a/examples/msgqueue.dpr +++ /dev/null @@ -1,36 +0,0 @@ -program msgqueue; -// -// Simple message queuing broker -// Same as request-reply broker but using QUEUE device -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -var - context: TZMQContext; - frontend, - backend: TZMQSocket; - -begin - context := TZMQContext.Create; - - // Socket facing clients - frontend := Context.Socket( stRouter ); - frontend.bind( 'tcp://*:5559' ); - - // Socket facing services - backend := Context.Socket( stDealer ); - backend.bind( 'tcp://*:5560' ); - - // Start built-in device - ZMQDevice( dQueue, frontend, backend ); - - // We never get here - frontend.Free; - backend.Free; - context.Free; -end. diff --git a/examples/msgqueue.dproj b/examples/msgqueue.dproj deleted file mode 100644 index 24a59aa..0000000 --- a/examples/msgqueue.dproj +++ /dev/null @@ -1,139 +0,0 @@ - - - {7DE2ACC4-28E9-45F9-B35C-6AA3B9529076} - msgqueue.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - ..\dcu - None - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1 - System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) - ..\;$(DCC_UnitSearchPath) - ..\bin - false - true - false - 1038 - false - false - - - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - true - - - None - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - - - - - msgqueue.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/msgqueue.res b/examples/msgqueue.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/msgqueue.res and /dev/null differ diff --git a/examples/mspoller.bdsproj b/examples/mspoller.bdsproj deleted file mode 100644 index 09a963e..0000000 --- a/examples/mspoller.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - mspoller.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/mspoller.cfg b/examples/mspoller.cfg deleted file mode 100644 index 4b4484a..0000000 --- a/examples/mspoller.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O- --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/mspoller.dof b/examples/mspoller.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/mspoller.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/mspoller.dpr b/examples/mspoller.dpr deleted file mode 100644 index 179182d..0000000 --- a/examples/mspoller.dpr +++ /dev/null @@ -1,58 +0,0 @@ -program mspoller; -// -// Reading from multiple sockets -// This version uses zmq_poll() -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -var - context: TZMQContext; - receiver, - subscriber: TZMQSocket; - i,pc: Integer; - task: TZMQFrame; - poller: TZMQPoller; - pollResult: TZMQPollItem; -begin - // Prepare our context and sockets - context := TZMQContext.Create; - - // Connect to task ventilator - receiver := Context.Socket( stPull ); - receiver.connect( 'tcp://localhost:5557' ); - - // Connect to weather server - subscriber := Context.Socket( stSub ); - subscriber.connect( 'tcp://localhost:5556' ); - subscriber.subscribe( '10001' ); - - // Initialize poll set - poller := TZMQPoller.Create( true ); - poller.Register( receiver, [pePollIn] ); - poller.Register( subscriber, [pePollIn] ); - - task := nil; - - // Process messages from both sockets - while True do - begin - pc := poller.poll; - for i := 0 to pc - 1 do - begin - pollResult := poller.pollResult[i]; - if pePollIn in pollResult.events then - pollResult.socket.recv( task ); - end; - FreeAndNil( task ); - end; - // We never get here - poller.Free; - receiver.Free; - subscriber.Free; - context.Free; -end. diff --git a/examples/mspoller.dproj b/examples/mspoller.dproj deleted file mode 100644 index 7269d1f..0000000 --- a/examples/mspoller.dproj +++ /dev/null @@ -1,139 +0,0 @@ - - - {2FBC9883-5318-4934-874B-B8B86ED87301} - mspoller.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - ..\dcu - None - ..\bin - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) - false - ..\;$(DCC_UnitSearchPath) - 1 - false - true - false - 1038 - false - false - - - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - true - - - None - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - - - - - mspoller.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/mspoller.res b/examples/mspoller.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/mspoller.res and /dev/null differ diff --git a/examples/msreader.bdsproj b/examples/msreader.bdsproj deleted file mode 100644 index 5cc3111..0000000 --- a/examples/msreader.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - msreader.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/msreader.cfg b/examples/msreader.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/msreader.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/msreader.dof b/examples/msreader.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/msreader.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/msreader.dpr b/examples/msreader.dpr deleted file mode 100644 index f1e7882..0000000 --- a/examples/msreader.dpr +++ /dev/null @@ -1,74 +0,0 @@ -program msreader; -// -// Reading from multiple sockets -// This version uses a simple recv loop -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -var - context: TZMQContext; - receiver, - subscriber: TZMQSocket; - rc: Boolean; - task, - update: TZMQFrame; -begin - // Prepare our context and sockets - context := TZMQContext.Create; - - // Connect to task ventilator - receiver := Context.Socket( stPull ); - receiver.connect( 'tcp://localhost:5557' ); - - // Connect to weather server - subscriber := Context.Socket( stSub ); - subscriber.connect( 'tcp://localhost:5556' ); - subscriber.subscribe( '10001' ); - - // Process messages from both sockets - // We prioritize traffic from the task ventilator - while True do - begin - // Process any waiting tasks - repeat - task := nil; - try - receiver.recv( task, [rfDontWait] ); - rc := true; - except - rc := False; - end; - if rc then - begin - // process task - end; - task.Free; - until rc; - // Process any waiting weather updates - repeat - update := nil; - Try - subscriber.recv( update, [rfDontWait] ); - rc := true; - except - rc := False; - end; - if rc then - begin - // process weather update - end; - update.Free; - until rc; - // No activity, so sleep for 1 msec - sleep (1); - end; - // We never get here but clean up anyhow - receiver.Free; - subscriber.Free; - context.Free; -end. diff --git a/examples/msreader.dproj b/examples/msreader.dproj deleted file mode 100644 index 6fb74de..0000000 --- a/examples/msreader.dproj +++ /dev/null @@ -1,139 +0,0 @@ - - - {0601838F-D4BA-4068-8DDE-5C11AF14DF75} - msreader.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - ..\dcu - None - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1 - System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) - ..\;$(DCC_UnitSearchPath) - ..\bin - false - true - false - 1038 - false - false - - - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - true - - - None - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - - - - - msreader.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/msreader.res b/examples/msreader.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/msreader.res and /dev/null differ diff --git a/examples/mtrelay.bdsproj b/examples/mtrelay.bdsproj deleted file mode 100644 index 5466f13..0000000 --- a/examples/mtrelay.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - mtrelay.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/mtrelay.cfg b/examples/mtrelay.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/mtrelay.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/mtrelay.dof b/examples/mtrelay.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/mtrelay.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/mtrelay.dpr b/examples/mtrelay.dpr deleted file mode 100644 index 8176659..0000000 --- a/examples/mtrelay.dpr +++ /dev/null @@ -1,67 +0,0 @@ -program mtrelay; -// -// Multithreaded relay -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -procedure step1( lcontext: TZMQContext ); -var - xmitter: TZMQSocket; -begin - // Connect to step2 and tell it we're ready - xmitter := lContext.Socket( stPair ); - xmitter.connect( 'inproc://step2' ); - Writeln( 'Step 1 ready, signaling step 2' ); - xmitter.send( 'READY' ); - xmitter.Free; -end; - -procedure step2( lcontext: TZMQContext ); -var - receiver, - xmitter: TZMQSocket; - s: String; - tid: Cardinal; -begin - // Bind inproc socket before starting step1 - receiver := lContext.Socket( stPair ); - receiver.bind( 'inproc://step2' ); - BeginThread( nil, 0, @step1, lcontext, 0, tid ); - - // Wait for signal and pass it on - receiver.recv( s ); - receiver.Free; - - // Connect to step3 and tell it we're ready - xmitter := lContext.Socket( stPair ); - xmitter.connect( 'inproc://step3' ); - Writeln( 'Step 2 ready, signaling step 3' ); - xmitter.send( 'READY' ); - xmitter.Free; -end; - -var - context: TZMQContext; - receiver: TZMQSocket; - tid: Cardinal; - s: String; -begin - context := TZMQContext.Create; - - // Bind inproc socket before starting step2 - receiver := Context.Socket( stPair ); - receiver.bind( 'inproc://step3' ); - BeginThread( nil, 0, @step2, context, 0, tid ); - - // Wait for signal - receiver.recv ( s ); - receiver.Free; - - Writeln( 'Test successful!' ); - context.Free; -end. diff --git a/examples/mtrelay.dproj b/examples/mtrelay.dproj deleted file mode 100644 index fb9bef2..0000000 --- a/examples/mtrelay.dproj +++ /dev/null @@ -1,138 +0,0 @@ - - - {FB7924ED-3F3E-4AB1-BC01-711BCA826C93} - mtrelay.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1 - System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) - ..\;$(DCC_UnitSearchPath) - ..\bin - false - true - false - 1038 - false - false - - - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - true - - - None - ..\dcu - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - - - - - mtrelay.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/mtrelay.res b/examples/mtrelay.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/mtrelay.res and /dev/null differ diff --git a/examples/mtserver.bdsproj b/examples/mtserver.bdsproj deleted file mode 100644 index 5a4147d..0000000 --- a/examples/mtserver.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - mtserver.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/mtserver.cfg b/examples/mtserver.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/mtserver.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/mtserver.dof b/examples/mtserver.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/mtserver.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/mtserver.dpr b/examples/mtserver.dpr deleted file mode 100644 index 9ae1cf0..0000000 --- a/examples/mtserver.dpr +++ /dev/null @@ -1,62 +0,0 @@ -program mtserver; -// -// Multithreaded Hello World server -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -procedure worker_routine( lcontext: TZMQContext ); -var - receiver: TZMQSocket; - s: String; -begin - // Socket to talk to dispatcher - receiver := lContext.Socket( stRep ); - receiver.connect( 'inproc://workers' ); - - while True do - begin - receiver.recv( s ); - Writeln( Format( 'Received request: [%s]', [s] ) ); - // Do some 'work' - sleep (1); - // Send reply back to client - receiver.send( 'World' ); - end; - receiver.Free; -end; - -var - context: TZMQContext; - clients, - workers: TZMQSocket; - i: Integer; - tid: Cardinal; -begin - context := TZMQContext.Create; - - // Socket to talk to clients - clients := Context.Socket( stRouter ); - clients.bind( 'tcp://*:5555' ); - - // Socket to talk to workers - workers := Context.Socket( stDealer ); - workers.bind( 'inproc://workers' ); - - // Launch pool of worker threads - for i := 0 to 4 do - begin - BeginThread( nil, 0, @worker_routine, context, 0, tid ); - end; - // Connect work threads to client threads via a queue - ZMQDevice( dQueue, clients, workers ); - - // We never get here but clean up anyhow - clients.Free; - workers.Free; - context.Free; -end. diff --git a/examples/mtserver.dproj b/examples/mtserver.dproj deleted file mode 100644 index b64d0fa..0000000 --- a/examples/mtserver.dproj +++ /dev/null @@ -1,138 +0,0 @@ - - - {B23D8DCC-0BA7-414E-BC3E-F26D69D33A7E} - mtserver.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1 - System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) - ..\;$(DCC_UnitSearchPath) - ..\bin - false - true - false - 1038 - false - false - - - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - true - - - None - ..\dcu - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - - - - - mtserver.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/mtserver.res b/examples/mtserver.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/mtserver.res and /dev/null differ diff --git a/examples/peering1.bdsproj b/examples/peering1.bdsproj deleted file mode 100644 index 2727dfb..0000000 --- a/examples/peering1.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - peering1.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/peering1.cfg b/examples/peering1.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/peering1.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/peering1.dpr b/examples/peering1.dpr deleted file mode 100644 index dce8d58..0000000 --- a/examples/peering1.dpr +++ /dev/null @@ -1,84 +0,0 @@ -program peering1; -// -// Broker peering simulation (part 1) -// Prototypes the state flow -// - -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -var - self, - peer: String; - ctx: TZMQContext; - statebe, - statefe: TZMQSocket; - i, rc: Integer; - poller: TZMQPoller; - peer_name, - available: String; -begin - // First argument is this broker's name - // Other arguments are our peers' names - // - if ParamCount < 2 then - begin - Writeln( 'syntax: peering1 me {you}...' ); - Halt( 1 ); - end; - - self := ParamStr( 1 ); - Writeln( Format( 'I: preparing broker at %s...', [self]) ); - Randomize; - - ctx := TZMQContext.create; - - // Bind state backend to endpoint - statebe := ctx.Socket( stPub ); - {$ifdef unix} - statebe.bind( Format( 'ipc://%s-state.ipc', [self] ) ); - {$else} - statebe.bind( Format( 'tcp://127.0.0.1:%s', [self] ) ); - {$endif} - - // Connect statefe to all peers - statefe := ctx.Socket( stSub ); - statefe.Subscribe(''); - - for i := 2 to ParamCount do - begin - peer := ParamStr( i ); - Writeln( Format( 'I: connecting to state backend at "%s"', [peer] ) ); - {$ifdef unix} - statefe.connect( Format( 'ipc://%s-state.ipc', [peer] ) ); - {$else} - statefe.connect( Format( 'tcp://127.0.0.1:%s', [peer] ) ); - {$endif} - end; - - // The main loop sends out status messages to peers, and collects - // status messages back from peers. The zmq_poll timeout defines - // our own heartbeat: - while not ctx.Terminated do - begin - // Poll for activity, or 1 second timeout - poller := TZMQPoller.Create( true ); - poller.Register( statefe, [pePollIn] ); - rc := poller.poll( 1000 ); - - // Handle incoming status messages - if rc > 0 then - //if pePollIn in poller.PollItem[0].events then - begin - statefe.recv( peer_name ); - statefe.recv( available ); - Writeln( Format( '%s - %s workers free', [ peer_name, available] ) ); - end else - statebe.send( [self, IntToStr( Random( 10 ) ) ] ); - end; - ctx.Free; -end. diff --git a/examples/peering2.bdsproj b/examples/peering2.bdsproj deleted file mode 100644 index 2892e51..0000000 --- a/examples/peering2.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - peering2.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/peering2.cfg b/examples/peering2.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/peering2.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/peering2.dpr b/examples/peering2.dpr deleted file mode 100644 index 15dbae4..0000000 --- a/examples/peering2.dpr +++ /dev/null @@ -1,301 +0,0 @@ -program peering2; -// -// Broker peering simulation (part 2) -// Prototypes the request-reply flow -// -{$APPTYPE CONSOLE} - -uses - Classes - , SysUtils - , zmqapi - ; - -const - NBR_CLIENTS = 10; - NBR_WORKERS = 3; - WORKER_READY = '\001'; // Signals worker is ready - -var - // Our own name; in practice this would be configured per node - self: String; - -// The client task does a request-reply dialog using a standard -// synchronous REQ socket: -procedure client_task( args: Pointer ); -var - ctx: TZMQContext; - client: TZMQSocket; - reply: String; -begin - ctx := TZMQContext.Create(); - client := ctx.Socket( stReq ); - {$ifdef unix} - client.connect( Format( 'ipc://%s-localfe.ipc', [self] ) ); - {$else} - client.connect( Format( 'tcp://127.0.0.1:%s', [self] ) ); - {$endif} - - while not ctx.Terminated do - begin - client.send( 'HELLO' ); - client.recv( reply ); - ZMQNote( Format( 'Client: %s', [reply] ) ); - sleep( 1 ); - end; - ctx.Free; -end; - -// The worker task plugs into the load-balancer using a REQ -// socket: -procedure worker_task( args: Pointer ); -var - ctx: TZMQContext; - worker: TZMQSocket; - msg: TZMQMsg; -begin - ctx := TZMQContext.create; - worker := ctx.Socket( stReq ); - {$ifdef unix} - worker.connect( Format( 'ipc://%s-localbe.ipc', [self] ) ); - {$else} - worker.connect( Format( 'tcp://127.0.0.1:1%s', [self] ) ); - {$endif} - - - // Tell broker we're ready for work - worker.send( WORKER_READY ); - - // Process messages as they arrive - while not ctx.Terminated do - begin - msg := TZMQMsg.create; - worker.recv( msg ); - - ZMQNote( Format( 'Worker: %s', [msg.last.dump ] ) ); - msg.last.asUtf8String := 'OK'; - worker.send( msg ); - end; - ctx.Free; -end; - -var - ctx: TZMQContext; - cloudfe, - cloudbe, - localfe, - localbe: TZMQSocket; - i: Integer; - peer, - s: String; - tid: Cardinal; - workers: TList; - pollerbe, - pollerfe: TZMQPoller; - rc,timeout: Integer; - msg: TZMQMsg; - identity, - frame: TZMQFrame; - data: Utf8String; - reroutable, - random_peer: Integer; - -// The main task begins by setting-up its frontend and backend sockets -// and then starting its client and worker tasks: -begin - // First argument is this broker's name - // Other arguments are our peers' names - // - if ParamCount < 2 then - begin - Writeln( 'syntax: peering2 me {you}...' ); - halt( 1 ); - end; - - // on windows it should be a 1024 <= number <= 9999 - self := ParamStr( 1 ); - writeln( Format( 'I: preparing broker at %s', [self] ) ); - randomize; - - ctx := TZMQContext.create; - - // Bind cloud frontend to endpoint - cloudfe := ctx.Socket( stRouter ); - cloudfe.Identity := self; - {$ifdef unix} - cloudfe.connect( Format( 'ipc://%s-cloud.ipc', [self] ) ); - {$else} - cloudfe.connect( Format( 'tcp://127.0.0.1:2%s', [self] ) ); - {$endif} - - // Connect cloud backend to all peers - cloudbe := ctx.Socket( stRouter ); - cloudbe.Identity := self; - - for i := 2 to ParamCount do - begin - peer := ParamStr( i ); - Writeln( Format( 'I: connecting to cloud frontend at "%s"', [peer] ) ); - {$ifdef unix} - cloudbe.connect( Format( 'ipc://%s-cloud.ipc', [peer] ) ); - {$else} - cloudbe.connect( Format( 'tcp://127.0.0.1:2%s', [peer] ) ); - {$endif} - end; - - // Prepare local frontend and backend - localfe := ctx.Socket( stRouter ); - {$ifdef unix} - localfe.connect( Format( 'ipc://%s-localfe.ipc', [self] ) ); - {$else} - localfe.connect( Format( 'tcp://127.0.0.1:%s', [self] ) ); - {$endif} - - localbe := ctx.Socket( stRouter ); - {$ifdef unix} - localbe.connect( Format( 'ipc://%s-localbe.ipc', [self] ) ); - {$else} - localbe.connect( Format( 'tcp://127.0.0.1:1%s', [self] ) ); - {$endif} - - // Get user to tell us when we can start… - Writeln( 'Press Enter when all brokers are started: '); - Readln( s ); - - // Start local workers - for i := 0 to NBR_WORKERS - 1 do - BeginThread( nil, 0, @worker_task, nil, 0, tid ); - - // Start local clients - for i := 0 to NBR_CLIENTS - 1 do - BeginThread( nil, 0, @client_task, nil, 0, tid ); - - // Here we handle the request-reply flow. We're using load-balancing - // to poll workers at all times, and clients only when there are one or - // more workers available. - - // Least recently used queue of available workers - workers := TList.Create; - - pollerbe := TZMQPoller.Create( true ); - pollerbe.Register( localbe, [pePollIn] ); - pollerbe.Register( cloudbe, [pePollIn] ); - - // I could do it with one poller too. - pollerfe := TZMQPoller.Create( true ); - pollerfe.Register( localfe, [pePollIn] ); - pollerfe.Register( cloudfe, [pePollIn] ); - - while not ctx.Terminated do - begin - // First, route any waiting replies from workers - - // If we have no workers anyhow, wait indefinitely - if workers.count = 0 then - timeout := -1 - else - timeout := 1000; - - rc := pollerbe.poll( timeout ); - msg := nil; - - // Handle reply from local worker - if pePollIn in pollerbe.PollItem[0].events then - begin - msg := TZMQMsg.Create; - pollerbe.PollItem[0].socket.recv( msg ); - identity := msg.unwrap; - workers.Add( identity ); - // If it's READY, don't route the message any further - frame := msg.first; - if frame.asUtf8String = WORKER_READY then - begin - msg.Free; - msg := nil; - end; - - // Or handle reply from peer broker - end else - if pePollIn in pollerbe.PollItem[1].events then - begin - - msg := TZMQMsg.create; - pollerbe.PollItem[1].socket.recv( msg ); - - // We don't use peer broker identity for anything - identity := msg.unwrap; - identity.Free; - end; - - // Route reply to cloud if it's addressed to a broker - if msg <> nil then - for i := 2 to ParamCount do - begin - data := msg.first.asUtf8String; - if data = ParamStr( i ) then - cloudfe.send( msg ); - end; - - // Route reply to client if we still need to - if msg <> nil then - localfe.send( msg ); - - // Now we route as many client requests as we have worker capacity - // for. We may reroute requests from our local frontend, but not from // - // the cloud frontend. We reroute randomly now, just to test things - // out. In the next version we'll do this properly by calculating - // cloud capacity:// - - while workers.Count > 0 do - begin - rc := pollerfe.poll( 0 ); - Assert( rc >= 0 ); - - // We'll do peer brokers first, to prevent starvation - if pePollIn in pollerfe.PollItem[1].events then - begin - msg := TZMQMsg.create; - cloudfe.recv( msg ); - reroutable := 0; - end else - if pePollIn in pollerfe.PollItem[0].events then - begin - msg := TZMQMsg.create; - localfe.recv( msg ); - reroutable := 1; - end else - break; // No work, go back to backends - - // If reroutable, send to cloud 20% of the time - // Here we'd normally use cloud status information - // - if ( reroutable > 0 ) and ( ParamCount > 2 ) and ( Random( 5 ) = 0 ) then - begin - // Route to random broker peer - random_peer := random( ParamCount - 2 ) + 2; - identity := TZMQFrame.create; - identity.asUtf8String := ParamStr( random_peer ); - msg.push( identity ); - cloudbe.send( msg ); - end else - begin - frame := workers[0]; - workers.Delete( 0 ); - msg.wrap( frame ); - localbe.send( msg ); - end; - end; - end; - - // When we're done, clean up properly - while workers.Count > 0 do - begin - frame := workers[0]; - workers.Delete( 0 ); - frame.Free; - end; - workers.Free; - ctx.Free; - -end. - diff --git a/examples/psenvpub.bdsproj b/examples/psenvpub.bdsproj deleted file mode 100644 index 7a4ebe8..0000000 --- a/examples/psenvpub.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - psenvpub.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/psenvpub.cfg b/examples/psenvpub.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/psenvpub.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/psenvpub.dpr b/examples/psenvpub.dpr deleted file mode 100644 index 6e4a666..0000000 --- a/examples/psenvpub.dpr +++ /dev/null @@ -1,33 +0,0 @@ -program psenvpub; -// -// Pubsub envelope publisher -// Note that the zhelpers.h file also provides s_sendmore -// - -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -var - context: TZMQContext; - publisher: TZMQSocket; -begin - // Prepare our context and publisher - context := TZMQContext.Create; - publisher := context.Socket( stPub ); - publisher.bind( 'tcp://*:5563' ); - - while true do - begin - // Write two messages, each with an envelope and content - publisher.send( ['A', 'We don''t want to see this'] ); - publisher.send( ['B', 'We would like to see this'] ); - sleep(1); - end; - - publisher.Free; - context.Free; -end. diff --git a/examples/psenvsub.bdsproj b/examples/psenvsub.bdsproj deleted file mode 100644 index 72474f8..0000000 --- a/examples/psenvsub.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - psenvsub.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/psenvsub.cfg b/examples/psenvsub.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/psenvsub.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/psenvsub.dpr b/examples/psenvsub.dpr deleted file mode 100644 index 7ff2e93..0000000 --- a/examples/psenvsub.dpr +++ /dev/null @@ -1,34 +0,0 @@ -program psenvsub; -// -// Pubsub envelope subscriber -// - -{$APPTYPE CONSOLE} - -uses - Classes - , SysUtils - , zmqapi - ; - -var - context: TZMQContext; - subscriber: TZMQSocket; - msg: TStringList; -begin - // Prepare our context and subscriber - context := TZMQContext.create; - subscriber := context.Socket( stSub ); - subscriber.connect( 'tcp://localhost:5563' ); - subscriber.Subscribe( 'B' ); - msg := TStringList.Create; - while true do - begin - msg.Clear; - subscriber.recv( msg ); - Writeln( Format( '[%s] %s', [msg[0], msg[1]] ) ); - end; - msg.Free; - subscriber.Free; - context.Free; -end. diff --git a/examples/rrbroker.bdsproj b/examples/rrbroker.bdsproj deleted file mode 100644 index ac66eb9..0000000 --- a/examples/rrbroker.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - rrbroker.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/rrbroker.cfg b/examples/rrbroker.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/rrbroker.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/rrbroker.dof b/examples/rrbroker.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/rrbroker.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/rrbroker.dpr b/examples/rrbroker.dpr deleted file mode 100644 index 0079369..0000000 --- a/examples/rrbroker.dpr +++ /dev/null @@ -1,69 +0,0 @@ -program rrbroker; -// -// Simple request-reply broker -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -var - context: TZMQContext; - frontend, - backend: TZMQSocket; - poller: TZMQPoller; - frame: TZMQFrame; - more: Boolean; - i,pc: Integer; - pollResult: TZMQPollItem; - otherSocket: TZMQSocket; - -begin - // Prepare our context and sockets - context := TZMQContext.Create; - frontend := Context.Socket( stRouter ); - backend := Context.Socket( stDealer ); - frontend.bind( 'tcp://*:5559' ); - backend.bind( 'tcp://*:5560' ); - - // Initialize poll set - poller := TZMQPoller.Create( true ); - poller.register( frontend, [pePollIn] ); - poller.register( backend, [pePollIn] ); - - // Switch messages between sockets - while True do - begin - pc := poller.poll; - for i := 0 to pc - 1 do - begin - pollResult := poller.pollResult[i]; - more := True; - if pollResult.socket = frontend then - otherSocket := backend - else - otherSocket := frontend; - - if pePollIn in pollResult.events then - while more do - begin - // Process all parts of the message - frame := TZMQFrame.Create; - pollResult.socket.recv( frame ); - more := pollResult.socket.rcvMore; - if more then - otherSocket.send( frame, [sfSndMore] ) - else - otherSocket.send( frame, [] ); - end; - - end; - end; - // We never get here but clean up anyhow - poller.Free; - frontend.Free; - backend.Free; - context.Free; -end. diff --git a/examples/rrbroker.dproj b/examples/rrbroker.dproj deleted file mode 100644 index df95152..0000000 --- a/examples/rrbroker.dproj +++ /dev/null @@ -1,139 +0,0 @@ - - - {DC5F3DD6-0BF9-45E4-B2F5-966E27CD3A40} - rrbroker.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - ..\dcu - None - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1 - System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) - ..\;$(DCC_UnitSearchPath) - ..\bin - false - true - false - 1038 - false - false - - - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - true - - - None - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - - - - - rrbroker.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/rrbroker.res b/examples/rrbroker.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/rrbroker.res and /dev/null differ diff --git a/examples/rrclient.bdsproj b/examples/rrclient.bdsproj deleted file mode 100644 index ea022d6..0000000 --- a/examples/rrclient.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - rrclient.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/rrclient.cfg b/examples/rrclient.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/rrclient.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/rrclient.dof b/examples/rrclient.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/rrclient.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/rrclient.dpr b/examples/rrclient.dpr deleted file mode 100644 index 33a9a53..0000000 --- a/examples/rrclient.dpr +++ /dev/null @@ -1,34 +0,0 @@ -program rrclient; -// -// Hello World client -// Connects REQ socket to tcp://localhost:5559 -// Sends "Hello" to server, expects "World" back -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -var - context: TZMQContext; - requester: TZMQSocket; - i: Integer; - s: String; -begin - context := TZMQContext.Create; - - // Socket to talk to server - requester := Context.Socket( stReq ); - requester.connect( 'tcp://localhost:5559' ); - - for i := 0 to 9 do - begin - requester.send( 'Hello' ); - requester.recv( s ); - Writeln( Format( 'Received reply %d [%s]',[i, s] ) ); - end; - requester.Free; - context.Free; -end. diff --git a/examples/rrclient.dproj b/examples/rrclient.dproj deleted file mode 100644 index 1920a1b..0000000 --- a/examples/rrclient.dproj +++ /dev/null @@ -1,139 +0,0 @@ - - - {7D2FB69B-14D5-4D86-995D-817753989D19} - rrclient.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - ..\dcu - None - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1 - System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) - ..\;$(DCC_UnitSearchPath) - ..\bin - false - true - false - 1038 - false - false - - - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - true - - - None - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - - - - - rrclient.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/rrclient.res b/examples/rrclient.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/rrclient.res and /dev/null differ diff --git a/examples/rrserver.bdsproj b/examples/rrserver.bdsproj deleted file mode 100644 index e09a8f4..0000000 --- a/examples/rrserver.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - rrserver.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/rrserver.cfg b/examples/rrserver.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/rrserver.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/rrserver.dof b/examples/rrserver.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/rrserver.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/rrserver.dpr b/examples/rrserver.dpr deleted file mode 100644 index 82554ba..0000000 --- a/examples/rrserver.dpr +++ /dev/null @@ -1,40 +0,0 @@ -program rrserver; -// -// Hello World server -// Connects REP socket to tcp://*:5560 -// Expects "Hello" from client, replies with "World" -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -var - context: TZMQContext; - responder: TZMQSocket; - s: String; -begin - context := TZMQContext.Create; - - // Socket to talk to clients - responder := Context.Socket( stRep ); - responder.connect( 'tcp://localhost:5560' ); - - while True do - begin - // Wait for next request from client - responder.recv( s ); - Writeln( Format( 'Received request: [%s]', [ s ] ) ); - - // Do some 'work' - sleep( 1 ); - - // Send reply back to client - responder.send( 'World' ); - end; - // We never get here but clean up anyhow - responder.Free; - context.Free; -end. diff --git a/examples/rrserver.dproj b/examples/rrserver.dproj deleted file mode 100644 index 113f832..0000000 --- a/examples/rrserver.dproj +++ /dev/null @@ -1,139 +0,0 @@ - - - {81BF7078-BF8E-4776-9506-FA70B681EC92} - rrserver.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - ..\dcu - None - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1 - System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) - ..\;$(DCC_UnitSearchPath) - ..\bin - false - true - false - 1038 - false - false - - - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - true - - - None - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - - - - - rrserver.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/rrserver.res b/examples/rrserver.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/rrserver.res and /dev/null differ diff --git a/examples/rtdealer.bdsproj b/examples/rtdealer.bdsproj deleted file mode 100644 index 7d999a2..0000000 --- a/examples/rtdealer.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - rtdealer.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/rtdealer.cfg b/examples/rtdealer.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/rtdealer.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/rtdealer.dpr b/examples/rtdealer.dpr deleted file mode 100644 index f4179f0..0000000 --- a/examples/rtdealer.dpr +++ /dev/null @@ -1,133 +0,0 @@ -program rtdealer; -// -// Custom routing Router to Dealer -// - -{$APPTYPE CONSOLE} - -uses - Classes - , SysUtils - , windows - , zmqapi; - -// We have two workers, here we copy the code, normally these would -// run on different boxes… -// -var - cs: TRTLCriticalSection; - -procedure Note( str: String ); -begin - EnterCriticalSection( cs ); - Writeln( str ); - LeaveCriticalSection( cs ); -end; - -procedure worker_task_a( args: Pointer ); -var - context: TZMQContext; - worker: TZMQSocket; - total: Integer; - finished: Boolean; - request: String; -begin - context := TZMQContext.create; - worker := context.Socket( stDealer ); - worker.Identity := 'A'; - worker.connect( 'tcp://127.0.0.1:5555' ); - - total := 0; - finished := false; - while not finished do - begin - // We receive one part, with the workload - worker.recv( request ); - finished := request = 'END'; - if not finished then - inc( total ); - end; - Note( Format('A received: %d',[total] ) ); - worker.Free; - context.Free; -end; - -procedure worker_task_b( args: Pointer ); -var - context: TZMQContext; - worker: TZMQSocket; - total: Integer; - finished: Boolean; - request: String; -begin - context := TZMQContext.create; - worker := context.Socket( stDealer ); - worker.Identity := 'B'; - worker.connect( 'tcp://127.0.0.1:5555' ); - - total := 0; - finished := false; - while not finished do - begin - // We receive one part, with the workload - worker.recv( request ); - finished := request = 'END'; - if not finished then - inc( total ); - end; - Note( Format('B received: %d',[total] ) ); - worker.Free; - context.Free; -end; - -// After we've defined the two worker tasks, we have the main task. -// Recall that these three tasks could be in separate processes, even -// running on different boxes. It's just easier to start by writing -// these in a single program. The main task starts the two workers, -// then scatters tasks to the workers. It sends an END message to each -// worker to tell them to exit: - -var - context: TZMQContext; - client: TZMQSocket; - tid1,tid2: Cardinal; - i: Integer; -begin - InitializeCriticalSection( cs ); - - context := TZMQContext.create; - client := context.Socket( stRouter ); - client.bind( 'tcp://127.0.0.1:5555' ); - - BeginThread( nil, 0, @worker_task_a, nil, 0, tid1 ); - BeginThread( nil, 0, @worker_task_b, nil, 0, tid2 ); - - // Wait for threads to connect, since otherwise the messages - // we send won't be routable. - sleep(100); - - // Send 10 tasks scattered to A twice as often as B - Randomize; - - for i := 0 to 9 do - begin - // Send two message parts, first the address... - if Random > 0.33 then - client.send('A', [sfSndMore] ) -// client.send( ['A', 'This is the workload'] ) - else - client.send('B', [sfSndMore] ); -// client.send( ['B', 'This is the workload'] ) - - // And then the workload - client.send( 'This is the workload' ); - end; - client.send( ['A','END'] ); - client.send( ['B','END'] ); - - client.Free; - context.Free; - sleep(1000); - DeleteCriticalSection( cs ); -end. - diff --git a/examples/rtmama.bdsproj b/examples/rtmama.bdsproj deleted file mode 100644 index c605e1b..0000000 --- a/examples/rtmama.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - rtmama.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/rtmama.cfg b/examples/rtmama.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/rtmama.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/rtmama.dpr b/examples/rtmama.dpr deleted file mode 100644 index 3fc3d65..0000000 --- a/examples/rtmama.dpr +++ /dev/null @@ -1,112 +0,0 @@ -program rtmama; -// -// Custom routing Router to Mama (ROUTER to REQ) -// - -{$APPTYPE CONSOLE} - -uses - Windows - , SysUtils - , zmqapi - ; - -const - NBR_WORKERS = 10; - -var - cs: TRTLCriticalSection; - -procedure Note( str: String ); -begin - EnterCriticalSection( cs ); - Writeln( str ); - LeaveCriticalSection( cs ); -end; - -procedure worker_task( args: Pointer ); -var - context: TZMQContext; - worker: TZMQSocket; - total: Integer; - finished: Boolean; - workload: String; -begin - context := TZMQContext.create; - worker := context.Socket( stReq ); - // We use a string identity for ease here - worker.Identity := IntToHex( Integer(context),8 ); - worker.connect( 'tcp://127.0.0.1:5555' ); - - total := 0; - finished := false; - while not finished do - begin - // Tell the router we're ready for work - worker.send( 'ready' ); - - // Get workload from router, until finished - worker.recv( workload ); - finished := workload = 'END'; - if not finished then - begin - inc( total ); - // Do some random work - sleep( random(1000) + 1 ); - end; - end; - Note( Format('Processed: %d tasks',[total] ) ); - worker.Free; - context.Free; -end; - -// While this example runs in a single process, that is just to make -// it easier to start and stop the example. Each thread has its own -// context and conceptually acts as a separate process. - -var - context: TZMQContext; - client: TZMQSocket; - i: Integer; - tid :Cardinal; - address - , empty - , ready: String; - -begin - InitializeCriticalSection( cs ); - - context := TZMQContext.create; - client := context.Socket( stRouter ); - client.bind( 'tcp://127.0.0.1:5555' ); - Randomize; - for i := 0 to NBR_WORKERS - 1 do - BeginThread( nil, 0, @worker_task, nil, 0, tid ); - - for i := 0 to NBR_WORKERS * 10 - 1 do - begin - // LRU worker is next waiting in queue - client.recv( address ); - client.recv( empty ); - client.recv( ready ); - - client.send( [address, '', 'This is the workload'] ); - end; - - // Now ask mamas to shut down and report their results - for i := 0 to NBR_WORKERS - 1 do - begin - client.recv( address ); - client.recv( empty ); - client.recv( ready ); - - client.send( [address, '', 'END'] ); - end; - - client.Free; - context.Free; - DeleteCriticalSection( cs ); - -end. - - diff --git a/examples/rtpapa.bdsproj b/examples/rtpapa.bdsproj deleted file mode 100644 index ab6ac7c..0000000 --- a/examples/rtpapa.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - rtpapa.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/rtpapa.cfg b/examples/rtpapa.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/rtpapa.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/rtpapa.dpr b/examples/rtpapa.dpr deleted file mode 100644 index 401e432..0000000 --- a/examples/rtpapa.dpr +++ /dev/null @@ -1,54 +0,0 @@ -program rtpapa; -// -// Custom routing Router to Papa (ROUTER to REP) -// - -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -var - context: TZMQContext; - client - , worker: TZMQSocket; -begin - // We will do this all in one thread to emphasize the sequence - // of events… - context := TZMQContext.create; - client := context.Socket( stRouter ); - client.bind( 'tcp://127.0.0.1:5555' ); - - worker := context.Socket( stRep ); - worker.Identity := 'A'; - worker.connect( 'tcp://127.0.0.1:5555' ); - - // Wait for the worker to connect so that when we send a message - // with routing envelope, it will actually match the worker… - sleep( 10 ); - - // Send papa address, address stack, empty part, and request - client.send([ - 'A', - 'address 3', - 'address 2', - 'address 1', - '', - 'This is the workload' - ]); - - // Worker should get just the workload - //worker.dump; [todo] - - // We don't play with envelopes in the worker - worker.send( 'This is the reply' ); - - // Now dump what we got off the ROUTER socket… - //client.dump; [todo] - - client.Free; - worker.Free; - context.Free; -end. diff --git a/examples/spqueue.bdsproj b/examples/spqueue.bdsproj deleted file mode 100644 index f755c58..0000000 --- a/examples/spqueue.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - spqueue.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/spqueue.cfg b/examples/spqueue.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/spqueue.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/spqueue.dpr b/examples/spqueue.dpr deleted file mode 100644 index d053663..0000000 --- a/examples/spqueue.dpr +++ /dev/null @@ -1,85 +0,0 @@ -program spqueue; -// -// Simple Pirate broker -// This is identical to load-balancing pattern, with no reliability -// mechanisms. It depends on the client for recovery. Runs forever. -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -const - WORKER_READY = '\001'; // Signals worker is ready - -var - ctx: TZMQContext; - frontend, - backend: TZMQSocket; - workers: TZMQMsg; - poller: TZMQPoller; - rc,pc: Integer; - msg: TZMQMsg; - identity, - frame: TZMQFrame; -begin - ctx := TZMQContext.create; - frontend := ctx.Socket( stRouter ); - backend := ctx.Socket( stRouter ); - frontend.bind( 'tcp://*:5555' ); // For clients - backend.bind( 'tcp://*:5556' ); // For workers - - // Queue of available workers - workers := TZMQMsg.create; - - poller := TZMQPoller.Create( true ); - poller.Register( backend, [pePollIn] ); - poller.Register( frontend, [pePollIn] ); - - - // The body of this example is exactly the same as lbbroker2. - while not ctx.Terminated do - begin - // Poll frontend only if we have available workers - if workers.size > 0 then - pc := 2 - else - pc := 1; - rc := poller.poll( 1000, pc ); - if rc = 0 then - continue; - - // Handle worker activity on backend - if pePollIn in poller.PollItem[0].revents then - begin - // Use worker identity for load-balancing - backend.recv( msg ); - identity := msg.unwrap; - workers.add( identity ); - - // Forward message to client if it's not a READY - frame := msg.first; - if frame.asUtf8String = WORKER_READY then - begin - msg.Free; - msg := nil; - end else - frontend.send( msg ); - end; - - if pePollIn in poller.PollItem[1].revents then - begin - // Get client request, route to first available worker - frontend.recv( msg ); - msg.wrap( workers.pop ); - backend.send( msg ); - end; - - end; - - workers.Free; - ctx.Free; -end. - diff --git a/examples/spworker.bdsproj b/examples/spworker.bdsproj deleted file mode 100644 index b25f203..0000000 --- a/examples/spworker.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - spworker.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/spworker.cfg b/examples/spworker.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/spworker.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/spworker.dpr b/examples/spworker.dpr deleted file mode 100644 index 057d2c3..0000000 --- a/examples/spworker.dpr +++ /dev/null @@ -1,64 +0,0 @@ -program spworker; -// -// Simple Pirate worker -// Connects REQ socket to tcp://*:5556 -// Implements worker part of load-balancing -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -const - WORKER_READY = '\001'; // Signals worker is ready - -var - ctx: TZMQContext; - worker: TZMQSocket; - identity: String; - frame: TZMQFrame; - cycles: Integer; - msg: TZMQMsg; -begin - ctx := TZMQContext.create; - worker := ctx.Socket( stReq ); - - // Set random identity to make tracing easier - randomize; - identity := IntToHex( Random( 1000000 ), 8 ); - worker.Identity := identity; - worker.connect( 'tcp://localhost:5556' ); - - // Tell broker we're ready for work - Writeln( Format( 'I: (%s) worker ready', [identity] ) ); - frame := TZMQFrame.create; - frame.asUtf8String := WORKER_READY; - worker.send( frame ); - cycles := 0; - while not ctx.Terminated do - begin - worker.recv( msg ); - - // Simulate various problems, after a few cycles - Inc( cycles ); - - if ((cycles > 3) and (random(5) = 0)) then - begin - Writeln( Format( 'I: (%s) simulating a crash', [identity] ) ); - msg.Free; - msg := nil; - break; - end else - if ( (cycles > 3) and (random(5) = 0) ) then - begin - Writeln( Format( 'I: (%s) simulating CPU overload', [identity] )); - sleep (3); - end; - Writeln( Format('I: (%s) normal reply', [identity]) ); - sleep(1); // Do some heavy work - worker.send( msg ); - end; - ctx.Free; -end. diff --git a/examples/syncpub.bdsproj b/examples/syncpub.bdsproj deleted file mode 100644 index 6bdd648..0000000 --- a/examples/syncpub.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - syncpub.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/syncpub.cfg b/examples/syncpub.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/syncpub.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/syncpub.dpr b/examples/syncpub.dpr deleted file mode 100644 index acf4162..0000000 --- a/examples/syncpub.dpr +++ /dev/null @@ -1,56 +0,0 @@ -program syncpub; -// -// Synchronized publisher -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqApi - ; - -const - SUBSCRIBERS_EXPECTED = 2; - -var - context: TZMQContext; - publisher, - syncservice: TZMQSocket; - subscribers: Integer; - str: String; - i: Integer; -begin - // We wait for 10 subscribers - context := TZMQContext.create; - - // Socket to talk to clients - publisher := Context.Socket( stPub ); - publisher.bind( 'tcp://*:5561' ); - - // Socket to receive signals - syncservice := Context.Socket( stRep ); - syncservice.bind( 'tcp://*:5562' ); - - // Get synchronization from subscribers - Writeln( 'Waiting for subscribers' ); - subscribers := 0; - while ( subscribers < SUBSCRIBERS_EXPECTED ) do - begin - // - wait for synchronization request - syncservice.recv( str ); - // - send synchronization reply - syncservice.send( '' ); - Inc( subscribers ); - end; - - // Now broadcast exactly 1M updates followed by END - Writeln( 'Broadcasting messages' ); - for i := 0 to 1000000 - 1 do - publisher.send( 'Rhubarb' ); - - publisher.send( 'END' ); - - publisher.Free; - syncservice.Free; - context.Free; -end. diff --git a/examples/syncsub.bdsproj b/examples/syncsub.bdsproj deleted file mode 100644 index 12fdbd8..0000000 --- a/examples/syncsub.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - syncsub.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/syncsub.cfg b/examples/syncsub.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/syncsub.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/syncsub.dpr b/examples/syncsub.dpr deleted file mode 100644 index d591d89..0000000 --- a/examples/syncsub.dpr +++ /dev/null @@ -1,53 +0,0 @@ -program syncsub; -// -// Synchronized subscriber -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqApi - ; - -var - context: TZMQContext; - subscriber, - syncclient: TZMQSocket; - str: String; - i: Integer; -begin - context := TZMQContext.Create; - - // First, connect our subscriber socket - subscriber := Context.Socket( stSub ); - subscriber.connect( 'tcp://localhost:5561' ); - subscriber.Subscribe( '' ); - - // 0MQ is so fast, we need to wait a while… - sleep (1); - - // Second, synchronize with publisher - syncclient := Context.Socket( stReq ); - syncclient.connect( 'tcp://localhost:5562' ); - - // - send a synchronization request - syncclient.send( '' ); - - // - wait for synchronization reply - syncclient.recv( str ); - - // Third, get our updates and report how many we got - i := 0; - while True do - begin - subscriber.recv( str ); - if str = 'END' then - break; - inc( i ); - end; - Writeln( Format( 'Received %d updates', [i] ) ); - - subscriber.Free; - syncclient.Free; - context.Free; -end. diff --git a/examples/tasksink.bdsproj b/examples/tasksink.bdsproj deleted file mode 100644 index a46c94a..0000000 --- a/examples/tasksink.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - tasksink.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/tasksink.cfg b/examples/tasksink.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/tasksink.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/tasksink.dof b/examples/tasksink.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/tasksink.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/tasksink.dpr b/examples/tasksink.dpr deleted file mode 100644 index 65ea37b..0000000 --- a/examples/tasksink.dpr +++ /dev/null @@ -1,56 +0,0 @@ -program tasksink; -// -// Task sink -// Binds PULL socket to tcp://localhost:5558 -// Collects results from workers via that socket -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , Windows - , zmqapi - ; - -const - task_count = 100; -var - context: TZMQContext; - receiver: TZMQSocket; - s: String; - - task_nbr: Integer; - fFrequency, - fstart, - fStop : Int64; -begin - // Prepare our context and socket - context := TZMQContext.Create; - receiver := Context.Socket( stPull ); - receiver.bind( 'tcp://*:5558' ); - - // Wait for start of batch - receiver.recv( s ); - - // Start our clock now - QueryPerformanceFrequency( fFrequency ); - QueryPerformanceCounter( fStart ); - - // Process 100 confirmations - for task_nbr := 0 to task_count - 1 do - begin - receiver.recv( s ); - if ((task_nbr / 10) * 10 = task_nbr) then - Write( ':' ) - else - Write( '.' ); - end; - // Calculate and report duration of batch - QueryPerformanceCounter( fStop ); - Writeln( Format( 'Total elapsed time: %d msec', [ - ((MSecsPerSec * (fStop - fStart)) div fFrequency) ]) ); - - receiver.Free; - context.Free; - - end. diff --git a/examples/tasksink.dproj b/examples/tasksink.dproj deleted file mode 100644 index 1c4fdbf..0000000 --- a/examples/tasksink.dproj +++ /dev/null @@ -1,139 +0,0 @@ - - - {28C67A0F-8ABE-4013-A2B4-26A580CCA560} - tasksink.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - ..\dcu - None - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1 - System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) - ..\;$(DCC_UnitSearchPath) - ..\bin - false - true - false - 1038 - false - false - - - System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - true - - - None - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - - - - - tasksink.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/tasksink.res b/examples/tasksink.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/tasksink.res and /dev/null differ diff --git a/examples/tasksink2.bdsproj b/examples/tasksink2.bdsproj deleted file mode 100644 index 27a098c..0000000 --- a/examples/tasksink2.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - tasksink2.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/tasksink2.cfg b/examples/tasksink2.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/tasksink2.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/tasksink2.dof b/examples/tasksink2.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/tasksink2.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/tasksink2.dpr b/examples/tasksink2.dpr deleted file mode 100644 index 4a765c1..0000000 --- a/examples/tasksink2.dpr +++ /dev/null @@ -1,62 +0,0 @@ -program tasksink2; -// -// Task sink - design 2 -// Adds pub-sub flow to send kill signal to workers -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , Windows - , zmqapi - ; - -const - task_count = 100; -var - context: TZMQContext; - receiver, - controller: TZMQSocket; - s: String; - - task_nbr: Integer; - fFrequency, - fstart, - fStop : Int64; -begin - // Prepare our context and socket - context := TZMQContext.Create; - receiver := Context.Socket( stPull ); - receiver.bind( 'tcp://*:5558' ); - - // Socket for worker control - controller := Context.Socket( stPub ); - controller.bind( 'tcp://*:5559' ); - - // Wait for start of batch - receiver.recv( s ); - - // Start our clock now - QueryPerformanceFrequency( fFrequency ); - QueryPerformanceCounter( fStart ); - - // Process 100 confirmations - for task_nbr := 0 to task_count - 1 do - begin - receiver.recv( s ); - if ((task_nbr / 10) * 10 = task_nbr) then - Write( ':' ) - else - Write( '.' ); - end; - // Calculate and report duration of batch - QueryPerformanceCounter( fStop ); - Writeln( Format( 'Total elapsed time: %d msec', [ - ((MSecsPerSec * (fStop - fStart)) div fFrequency) ]) ); - - controller.send( 'KILL' ); - receiver.Free; - controller.Free; - context.Free; - -end. diff --git a/examples/tasksink2.dproj b/examples/tasksink2.dproj deleted file mode 100644 index 93630d8..0000000 --- a/examples/tasksink2.dproj +++ /dev/null @@ -1,139 +0,0 @@ - - - {9C2BFFDB-CCE6-4E72-A84E-1CA53DDAE190} - tasksink2.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - ..\dcu - None - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1 - System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) - ..\;$(DCC_UnitSearchPath) - ..\bin - false - true - false - 1038 - false - false - - - System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - true - - - None - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - - - - - tasksink2.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/tasksink2.res b/examples/tasksink2.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/tasksink2.res and /dev/null differ diff --git a/examples/taskvent.bdsproj b/examples/taskvent.bdsproj deleted file mode 100644 index 6cc6498..0000000 --- a/examples/taskvent.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - taskvent.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/taskvent.cfg b/examples/taskvent.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/taskvent.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/taskvent.dof b/examples/taskvent.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/taskvent.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/taskvent.dpr b/examples/taskvent.dpr deleted file mode 100644 index a0050ec..0000000 --- a/examples/taskvent.dpr +++ /dev/null @@ -1,63 +0,0 @@ -program taskvent; -// -// Task ventilator -// Binds PUSH socket to tcp://localhost:5557 -// Sends batch of tasks to workers via that socket -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi; - -const - task_count = 100; - -var - context: TZMQContext; - sender, - sink: TZMQSocket; - s: String; - task_nbr, - total_msec, - workload: Integer; - -begin - context := TZMQContext.Create; - - // Socket to send messages on - sender := Context.Socket( stPush ); - sender.bind( 'tcp://*:5557' ); - - // Socket to send start of batch message on - sink := Context.Socket( stPush ); - sink.connect( 'tcp://localhost:5558' ); - - Write( 'Press Enter when the workers are ready: ' ); - Readln( s ); // if you remove, no sync.. - Writeln( 'Sending tasks to workers' ); - - // The first message is "0" and signals start of batch - sink.send( '0' ); - - // Initialize random number generator - randomize; - - // Send 100 tasks - total_msec := 0; // Total expected cost in msecs - for task_nbr := 0 to task_count - 1 do - begin - // Random workload from 1 to 100msecs - workload := Random( 100 ) + 1; - total_msec := total_msec + workload; - - s := IntToStr( workload ); - sender.send( s ); - end; - Writeln( Format( 'Total expected cost: %d msec', [total_msec] ) ); - sleep(1); // Give 0MQ time to deliver - - sink.Free; - Sender.Free; - Context.Free; -end. diff --git a/examples/taskvent.dproj b/examples/taskvent.dproj deleted file mode 100644 index bffe802..0000000 --- a/examples/taskvent.dproj +++ /dev/null @@ -1,139 +0,0 @@ - - - {65B77E57-2EB4-46B5-A8F1-505A896DA953} - taskvent.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - ..\dcu - None - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1 - System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) - ..\;$(DCC_UnitSearchPath) - ..\bin - false - true - false - 1038 - false - false - - - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - true - - - None - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - - - - - taskvent.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/taskvent.res b/examples/taskvent.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/taskvent.res and /dev/null differ diff --git a/examples/taskwork.bdsproj b/examples/taskwork.bdsproj deleted file mode 100644 index 7a3ba86..0000000 --- a/examples/taskwork.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - taskwork.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/taskwork.cfg b/examples/taskwork.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/taskwork.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/taskwork.dof b/examples/taskwork.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/taskwork.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/taskwork.dpr b/examples/taskwork.dpr deleted file mode 100644 index 4e9a5eb..0000000 --- a/examples/taskwork.dpr +++ /dev/null @@ -1,48 +0,0 @@ -program taskwork; -// -// Task worker -// Connects PULL socket to tcp://localhost:5557 -// Collects workloads from ventilator via that socket -// Connects PUSH socket to tcp://localhost:5558 -// Sends results to sink via that socket -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -var - context: TZMQContext; - receiver, - sender: TZMQSocket; - s: String; -begin - context := TZMQContext.Create; - - // Socket to receive messages on - receiver := Context.Socket( stPull ); - receiver.connect( 'tcp://localhost:5557' ); - - // Socket to send messages to - sender := Context.Socket( stPush ); - sender.connect( 'tcp://localhost:5558' ); - - // Process tasks forever - while True do - begin - receiver.recv( s ); - // Simple progress indicator for the viewer - Writeln( s ); - - // Do the work - sleep( StrToInt( s ) ); - - // Send results to sink - sender.send(''); - end; - receiver.Free; - sender.Free; - context.Free; -end. diff --git a/examples/taskwork.dproj b/examples/taskwork.dproj deleted file mode 100644 index c352f7a..0000000 --- a/examples/taskwork.dproj +++ /dev/null @@ -1,139 +0,0 @@ - - - {E35FA72F-1003-44EE-B368-606D23276646} - taskwork.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - ..\dcu - None - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1 - System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) - ..\;$(DCC_UnitSearchPath) - ..\bin - false - true - false - 1038 - false - false - - - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - true - - - None - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - - - - - taskwork.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/taskwork.res b/examples/taskwork.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/taskwork.res and /dev/null differ diff --git a/examples/taskwork2.bdsproj b/examples/taskwork2.bdsproj deleted file mode 100644 index c8b1694..0000000 --- a/examples/taskwork2.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - taskwork2.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/taskwork2.cfg b/examples/taskwork2.cfg deleted file mode 100644 index 4b4484a..0000000 --- a/examples/taskwork2.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O- --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/taskwork2.dof b/examples/taskwork2.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/taskwork2.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/taskwork2.dpr b/examples/taskwork2.dpr deleted file mode 100644 index 9a11867..0000000 --- a/examples/taskwork2.dpr +++ /dev/null @@ -1,72 +0,0 @@ -program taskwork2; -// -// Task worker - design 2 -// Adds pub-sub flow to receive and respond to kill signal -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -var - context: TZMQContext; - receiver, - sender, - controller: TZMQSocket; - s: String; - poller: TZMQPoller; - pr: TZMQPollItem; - i,pc: Integer; - b: Boolean; -begin - b := True; - context := TZMQContext.Create; - - // Socket to receive messages on - receiver := Context.Socket( stPull ); - receiver.connect( 'tcp://localhost:5557' ); - - // Socket to send messages to - sender := Context.Socket( stPush ); - sender.connect( 'tcp://localhost:5558' ); - - controller := Context.Socket( stSub ); - controller.connect( 'tcp://localhost:5559' ); - controller.subscribe(''); - - poller := TZMQPoller.Create( true ); - poller.register( receiver, [pePollIn] ); - poller.register( controller, [pePollIn] ); - - // Process tasks forever - while b do - begin - pc := poller.poll; - for i := 0 to pc - 1 do - begin - pr := poller.pollResult[i]; - if pr.socket = receiver then - begin - receiver.recv( s ); - // Simple progress indicator for the viewer - Writeln( s ); - - // Do the work - sleep( StrToInt( s ) ); - - // Send results to sink - sender.send(''); - - end else - if pr.socket = controller then - b := False; - end; - end; - receiver.Free; - sender.Free; - controller.Free; - poller.Free; - context.Free; -end. diff --git a/examples/taskwork2.dproj b/examples/taskwork2.dproj deleted file mode 100644 index 58119fc..0000000 --- a/examples/taskwork2.dproj +++ /dev/null @@ -1,139 +0,0 @@ - - - {194CA84B-0642-4E63-8CAA-CB428BB63B44} - taskwork2.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - ..\dcu - None - ..\bin - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) - false - ..\;$(DCC_UnitSearchPath) - 1 - false - true - false - 1038 - false - false - - - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - true - - - None - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - - - - - taskwork2.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/taskwork2.res b/examples/taskwork2.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/taskwork2.res and /dev/null differ diff --git a/examples/version.bdsproj b/examples/version.bdsproj deleted file mode 100644 index 4c9b827..0000000 --- a/examples/version.bdsproj +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - - - - - - - version.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - Newton Package File - Microsoft Office 2000 Sample Automation Server Wrapper Components - - - diff --git a/examples/version.cfg b/examples/version.cfg deleted file mode 100644 index d7e9af5..0000000 --- a/examples/version.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N"..\dcu" --LE"c:\program files\borland\delphi7\Projects\Bpl" --LN"c:\program files\borland\delphi7\Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/version.dof b/examples/version.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/version.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/version.dpr b/examples/version.dpr deleted file mode 100644 index 77c8bf5..0000000 --- a/examples/version.dpr +++ /dev/null @@ -1,20 +0,0 @@ -program version; -// -// Report 0MQ version -// - -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -var - major, - minor, - patch: Integer; -begin - ZMQVersion( major, minor, patch ); - Writeln( Format( 'Current 0MQ version is %d.%d.%d', [major, minor, patch]) ); -end. diff --git a/examples/version.dproj b/examples/version.dproj deleted file mode 100644 index 3272dbb..0000000 --- a/examples/version.dproj +++ /dev/null @@ -1,139 +0,0 @@ - - - {10D88935-BDC4-4C59-B3CC-E40177D8C85D} - version.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - ..\dcu - None - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1 - System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) - ..\;$(DCC_UnitSearchPath) - ..\bin - false - true - false - 1038 - false - false - - - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - true - - - None - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - - - - - version.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/version.res b/examples/version.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/version.res and /dev/null differ diff --git a/examples/wuclient.bdsproj b/examples/wuclient.bdsproj deleted file mode 100644 index 3afcc74..0000000 --- a/examples/wuclient.bdsproj +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - - - - - - - wuclient.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - Newton Package File - Microsoft Office 2000 Sample Automation Server Wrapper Components - - - diff --git a/examples/wuclient.cfg b/examples/wuclient.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/wuclient.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/wuclient.dof b/examples/wuclient.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/wuclient.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/wuclient.dpr b/examples/wuclient.dpr deleted file mode 100644 index 13a9108..0000000 --- a/examples/wuclient.dpr +++ /dev/null @@ -1,54 +0,0 @@ -program wuclient; -// -// Weather update client -// Connects SUB socket to tcp://localhost:5556 -// Collects weather updates and finds avg temp in zipcode -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , Classes - , zmqapi - ; - -const - update_count = 100; - -var - context: TZMQContext; - subscriber: TZMQSocket; - - filter: String; - update_nbr: Integer; - total_temp: Integer = 0; - - s: String; - tsl: TStringList; -begin - context := TZMQContext.Create; - - // Socket to talk to server - Writeln ( 'Collecting updates from weather server' ); - subscriber := Context.Socket( stSub ); - subscriber.connect( 'tcp://localhost:5556' ); - - filter := '10001'; - subscriber.subscribe( filter ); - tsl := TStringList.Create; - tsl.Delimiter := ' '; - - for update_nbr := 0 to update_count - 1 do - begin - subscriber.recv( s ); - tsl.Clear; - tsl.DelimitedText := s; - total_temp := total_temp + StrToInt( tsl[1] ); - end; - Writeln( Format( 'Average temperature for zipcode "%s" was %fF', - [ filter, total_temp / update_count])); - - tsl.Free; - subscriber.Free; - context.Free; -end. diff --git a/examples/wuclient.dproj b/examples/wuclient.dproj deleted file mode 100644 index 01b804e..0000000 --- a/examples/wuclient.dproj +++ /dev/null @@ -1,139 +0,0 @@ - - - {AF46097B-03B6-4431-983F-6E281E51A75C} - wuclient.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - ..\dcu - None - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1 - System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) - ..\;$(DCC_UnitSearchPath) - ..\bin - false - true - false - 1038 - false - false - - - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - true - - - None - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - - - - - wuclient.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/wuclient.res b/examples/wuclient.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/wuclient.res and /dev/null differ diff --git a/examples/wuproxy.bdsproj b/examples/wuproxy.bdsproj deleted file mode 100644 index 507432e..0000000 --- a/examples/wuproxy.bdsproj +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - wuproxy.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - diff --git a/examples/wuproxy.cfg b/examples/wuproxy.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/wuproxy.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/wuproxy.dof b/examples/wuproxy.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/wuproxy.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/wuproxy.dpr b/examples/wuproxy.dpr deleted file mode 100644 index 90469c5..0000000 --- a/examples/wuproxy.dpr +++ /dev/null @@ -1,54 +0,0 @@ -program wuproxy; -// -// Weather proxy device -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -var - context: TZMQContext; - frontend, - backend: TZMQSocket; - frame: TZMQFrame; - more: Boolean; -begin - context := TZMQContext.Create; - - // This is where the weather server sits - frontend := Context.Socket( stSub ); - frontend.connect( 'tcp://192.168.55.210:5556' ); - - // This is our public endpoint for subscribers - backend := Context.Socket( stPub ); - backend.bind( 'tcp://10.1.1.0:8100' ); - - // Subscribe on everything - frontend.subscribe(''); - - // Shunt messages out to our own subscribers - while True do - begin - while True do - begin - frame := TZMQFrame.Create; - - // Process all parts of the message - frontend.recv( frame ); - more := frontend.rcvMore; - if more then - backend.send( frame, [sfSndMore] ) - else - backend.send( frame, [] ); - if not more then - break; // Last message part - end; - end; - // We don't actually get here but if we did, we'd shut down neatly - frontend.Free; - backend.Free; - context.Free; -end. diff --git a/examples/wuproxy.dproj b/examples/wuproxy.dproj deleted file mode 100644 index 9ea0fe9..0000000 --- a/examples/wuproxy.dproj +++ /dev/null @@ -1,139 +0,0 @@ - - - {937C9732-1FAD-4A77-9A5F-D95609E28CB4} - wuproxy.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - ..\dcu - None - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1 - System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) - ..\;$(DCC_UnitSearchPath) - ..\bin - false - true - false - 1038 - false - false - - - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - true - - - None - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - - - - - wuproxy.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/wuproxy.res b/examples/wuproxy.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/wuproxy.res and /dev/null differ diff --git a/examples/wuserver.bdsproj b/examples/wuserver.bdsproj deleted file mode 100644 index dfb78de..0000000 --- a/examples/wuserver.bdsproj +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - - - - - - - wuserver.dpr - - - 7.0 - - - 8 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 1 - 1 - True - True - WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; - - False - - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - True - False - False - False - True - True - True - True - True - True - - - - 0 - 0 - False - 1 - False - False - False - 16384 - 1048576 - 4194304 - - - - ..\bin - ..\dcu - - - ..\ - - - - False - - - - - - False - - - True - False - - - - $00000000 - - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - Newton Package File - Microsoft Office 2000 Sample Automation Server Wrapper Components - - - diff --git a/examples/wuserver.cfg b/examples/wuserver.cfg deleted file mode 100644 index 4a4d2bf..0000000 --- a/examples/wuserver.cfg +++ /dev/null @@ -1,44 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; --H+ --W+ --M --$M16384,1048576 --K$00400000 --E"..\bin" --N0"..\dcu" --LE"C:\Users\b\Documents\Borland Studio Projects\Bpl" --LN"C:\Users\b\Documents\Borland Studio Projects\Bpl" --U"..\" --O"..\" --I"..\" --R"..\" --w-UNSAFE_TYPE --w-UNSAFE_CODE --w-UNSAFE_CAST diff --git a/examples/wuserver.dof b/examples/wuserver.dof deleted file mode 100644 index 5198af3..0000000 --- a/examples/wuserver.dof +++ /dev/null @@ -1,148 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir=..\bin -UnitOutputDir=..\dcu -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=..\ -Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;JclDeveloperTools;Jcl;JclVcl;JclContainers;DISQLite3_D7;xf40_unr_d7;VirtualTreesD7 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1038 -CodePage=1250 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[HistoryLists\hlUnitAliases] -Count=1 -Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[HistoryLists\hlSearchPath] -Count=1 -Item0=..\ -[HistoryLists\hlUnitOutputDirectory] -Count=1 -Item0=..\dcu -[HistoryLists\hlOutputDirectorry] -Count=1 -Item0=..\bin diff --git a/examples/wuserver.dpr b/examples/wuserver.dpr deleted file mode 100644 index 637ed07..0000000 --- a/examples/wuserver.dpr +++ /dev/null @@ -1,38 +0,0 @@ -program wuserver; -// -// Weather update server -// Binds PUB socket to tcp://*:5556 -// Publishes random weather updates -// -{$APPTYPE CONSOLE} - -uses - SysUtils - , zmqapi - ; - -var - context : TZMQContext; - publisher : TZMQSocket; - - zipcode, - temperature, - relhumidity: Integer; -begin - // Prepare our context and publisher - context := TZMQContext.create; - publisher := Context.Socket( stPub ); - publisher.bind( 'tcp://*:5556' ); -// publisher.bind( 'ipc://weather.ipc' ); - - Randomize; - while True do - begin - zipcode := Random( 100000 ); - temperature := Random( 215 ) - 80; - relhumidity := Random( 50 ) + 10; - publisher.Send( Format( '%05d %d %d', [zipcode, temperature, relhumidity] ) ); - end; - publisher.Free; - context.Free; -end. diff --git a/examples/wuserver.dproj b/examples/wuserver.dproj deleted file mode 100644 index 5379079..0000000 --- a/examples/wuserver.dproj +++ /dev/null @@ -1,139 +0,0 @@ - - - {0963E04E-4BEB-4A73-AA61-9C6738B296FE} - wuserver.dpr - True - Debug - 1 - Console - None - 13.4 - Win32 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - ..\dcu - None - 00400000 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1 - System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) - ..\;$(DCC_UnitSearchPath) - ..\bin - false - true - false - 1038 - false - false - - - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - - - false - false - 0 - RELEASE;$(DCC_Define) - - - DEBUG;$(DCC_Define) - false - true - - - None - 1033 - - - - MainSource - - - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - - - - Delphi.Personality.12 - - - - - wuserver.dpr - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1038 - 1250 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - True - - - 12 - - - - diff --git a/examples/wuserver.res b/examples/wuserver.res deleted file mode 100644 index 7435995..0000000 Binary files a/examples/wuserver.res and /dev/null differ diff --git a/tests/PollTestCase.pas b/tests/PollTestCase.pas index 819957e..e32791d 100644 --- a/tests/PollTestCase.pas +++ b/tests/PollTestCase.pas @@ -70,7 +70,7 @@ procedure TPollTestCase.TearDown; procedure TPollTestCase.PollRegister; var sb,sc: TZMQSocket; - s: String; + s: Utf8String; begin New( zmqPollItem ); ehandle := CreateEvent( nil, true, false, nil ); diff --git a/tests/PushPullTestCase.pas b/tests/PushPullTestCase.pas index d7c70a6..4104f2c 100644 --- a/tests/PushPullTestCase.pas +++ b/tests/PushPullTestCase.pas @@ -58,7 +58,7 @@ procedure TPushPullTestCase.TearDown; procedure TPushPullTestCase.SendString; var sPush,sPull: TZMQSocket; - s: String; + s: Utf8String; rc: Integer; begin sPush := context.Socket( stPush ); @@ -96,7 +96,7 @@ procedure PushProc( lcontext: TZMQContext ); procedure TPushPullTestCase.SendStringThread; var sPull: TZMQSocket; - s: String; + s: Utf8String; rc: Integer; tid: Cardinal; begin @@ -121,7 +121,7 @@ procedure TPushPullTestCase.SendStringThread; procedure TPushPullTestCase.SendStringThreadFirstConnect; var sPull: TZMQSocket; - s: String; + s: Utf8String; rc: Integer; tid: Cardinal; begin diff --git a/tests/SocketTestCase.pas b/tests/SocketTestCase.pas index a927058..496b749 100644 --- a/tests/SocketTestCase.pas +++ b/tests/SocketTestCase.pas @@ -672,7 +672,7 @@ procedure TSocketTestCase.SocketPair; var socketbind, socketconnect: TZMQSocket; - s: String; + s: Utf8String; tsl: TStringList; begin socketbind := context.Socket( stPair ); diff --git a/zhelpers.pas b/zhelpers.pas new file mode 100644 index 0000000..a2e9184 --- /dev/null +++ b/zhelpers.pas @@ -0,0 +1,106 @@ +unit zhelpers; + +interface + +uses + SysUtils + , Classes + , zmqapi + ; + +procedure s_dump( socket: TZMQSocket ); +procedure s_set_id( socket: TZMQSocket ); + +// for threadSafe logging to the console. +procedure zNote( str: String ); + + +implementation + +uses + Windows; + +var + cs: TRTLCriticalSection; + +procedure zNote( str: String ); +begin + EnterCriticalSection( cs ); + Writeln( str ); + LeaveCriticalSection( cs ); +end; + +procedure s_dump( socket: TZMQSocket ); + + function validChar( frm: TZMQFrame; indx: Integer ): Boolean; + var + pb: PByte; + begin + pb := PByte(Integer(frm.data) + indx); + result := ( pb^ >= 32 ) and ( pb^ < 127 ); + end; + +var + msg: TZMQMsg; + frame: TZMQFrame; + i: Cardinal; + str: Utf8String; +begin + zNote( '----------------------------------------' ); + msg := TZMQMsg.create; + try + socket.recv( msg ); + frame := msg.pop; + while frame <> nil do + try + i := 0; + while ( i < frame.size ) and validChar( frame, i ) do + inc( i ); + + if i = frame.size then + str := frame.asUtf8String + else begin + SetLength( str, frame.size * 2 ); + BinToHex( frame.data, @str[1], frame.size ); + end; + zNote( Format( '[%03d] %s', [ frame.size, str ] ) ); + finally + frame.Free; + frame := msg.pop; + end; + finally + msg.Free; + end; +end; + +// Set simple random printable identity on socket +// +procedure s_set_id( socket: TZMQSocket ); +const + Chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'; +var + s: String; + i: integer; +begin + Randomize; + S := ''; + for i := 1 to 10 do + S := S + Chars[Random(Length(Chars)) + 1]; + socket.Identity := s; +end; + +initialization + {$ifdef UNIX} + InitCriticalSection( cs ); + {$else} + InitializeCriticalSection( cs ); + {$endif} + +finalization + {$ifdef UNIX} + DoneCriticalSection( cs ); + {$else} + DeleteCriticalSection( cs ); + {$endif} + +end. diff --git a/zmq.pas b/zmq.pas index 134bfb2..d66c743 100644 --- a/zmq.pas +++ b/zmq.pas @@ -251,12 +251,14 @@ function zmq_msg_recv (var msg: zmq_msg_t; s: Pointer; flags: Integer): Integer; {$ifdef zmq3} ZMQ_IPV4ONLY = 31; ZMQ_LAST_ENDPOINT = 32; - ZMQ_ROUTER_BEHAVIOR = 33; + ZMQ_ROUTER_MANDATORY = 33; ZMQ_TCP_KEEPALIVE = 34; ZMQ_TCP_KEEPALIVE_CNT = 35; ZMQ_TCP_KEEPALIVE_IDLE = 36; ZMQ_TCP_KEEPALIVE_INTVL = 37; ZMQ_TCP_ACCEPT_FILTER = 38; + ZMQ_DELAY_ATTACH_ON_CONNECT = 39; + ZMQ_XPUB_VERBOSE = 40; {* Message options *} ZMQ_MORE = 1; diff --git a/zmqapi.pas b/zmqapi.pas index bb7593a..33901df 100644 --- a/zmqapi.pas +++ b/zmqapi.pas @@ -216,7 +216,7 @@ TZMQMsg = class TZMQEvent = record event: TZMQMonitorEvent; - addr: String; + addr: AnsiString; case TZMQMonitorEvent of meConnected, meListening, @@ -245,7 +245,7 @@ TZMQEvent = record TZMQMonitorRec = record terminated: Boolean; context: TZMQContext; - addr: String; + addr: AnsiString; proc: TZMQMonitorProc; end; @@ -275,16 +275,16 @@ TZMQSocket = class function send( var msg: TZMQFrame; flags: Integer = 0 ): Integer; overload; function recv( var msg: TZMQFrame; flags: Integer = 0 ): Integer; overload; public - procedure bind( addr: String ); - procedure connect( addr: String ); + procedure bind( addr: AnsiString ); + procedure connect( addr: AnsiString ); {$ifdef zmq3} - procedure unbind( addr: String ); - procedure disconnect( addr: String ); + procedure unbind( addr: AnsiString ); + procedure disconnect( addr: AnsiString ); {$endif} // helpers private - procedure CheckResult( rc: Integer ); + function CheckResult( rc: Integer ): Integer; function getSockOptInt64( option: Integer ): Int64; function getSockOptInteger( option: Integer ): Integer; procedure setSockOptInt64( option: Integer; const Value: Int64 ); @@ -322,7 +322,7 @@ TZMQSocket = class procedure setMulticastHops( const Value: Integer ); function getIPv4Only: Boolean; procedure setIPv4Only( const Value: Boolean ); - function getLastEndpoint: String; + function getLastEndpoint: AnsiString; function getKeepAlive: TZMQKeepAlive; procedure setKeepAlive( const Value: TZMQKeepAlive ); function getKeepAliveIdle: Integer; @@ -331,8 +331,9 @@ TZMQSocket = class procedure setKeepAliveCnt( const Value: Integer ); function getKeepAliveIntvl: Integer; procedure setKeepAliveIntvl( const Value: Integer ); - function getAcceptFilter( indx: Integer ): String; - procedure setAcceptFilter( indx: Integer; const Value: String ); + function getAcceptFilter( indx: Integer ): AnsiString; + procedure setAcceptFilter( indx: Integer; const Value: AnsiString ); + procedure setRouterMandatory( const Value: Boolean ); {$else} function getSwap: Int64; function getRecoveryIvlMSec: Int64; @@ -356,15 +357,15 @@ TZMQSocket = class procedure setReconnectIvlMax( const Value: Integer ); procedure setBacklog( const Value: Integer ); - procedure Subscribe( filter: String ); - procedure unSubscribe( filter: String ); + procedure Subscribe( filter: AnsiString ); + procedure unSubscribe( filter: AnsiString ); function send( var msg: TZMQFrame; flags: TZMQSendFlags = [] ): Integer; overload; function send( strm: TStream; size: Integer; flags: TZMQSendFlags = [] ): Integer; overload; - function send( msg: String; flags: TZMQSendFlags = [] ): Integer; overload; + function send( msg: Utf8String; flags: TZMQSendFlags = [] ): Integer; overload; function send( var msgs: TZMQMsg; dontwait: Boolean = false ): Integer; overload; - function send( msg: Array of String; dontwait: Boolean = false ): Integer; overload; + function send( msg: Array of Utf8String; dontwait: Boolean = false ): Integer; overload; function send( msg: TStrings; dontwait: Boolean = false ): Integer; overload; {$ifdef zmq3} function sendBuffer( const Buffer; len: Size_t; flags: TZMQSendFlags = [] ): Integer; @@ -372,7 +373,7 @@ TZMQSocket = class function recv( msg: TZMQFrame; flags: TZMQRecvFlags = [] ): Integer; overload; function recv( strm: TStream; flags: TZMQRecvFlags = [] ): Integer; overload; - function recv( var msg: String; flags: TZMQRecvFlags = [] ): Integer; overload; + function recv( var msg: Utf8String; flags: TZMQRecvFlags = [] ): Integer; overload; function recv( var msgs: TZMQMsg; flags: TZMQRecvFlags = [] ): Integer; overload; function recv( msg: TStrings; flags: TZMQRecvFlags = [] ): Integer; overload; @@ -393,14 +394,16 @@ TZMQSocket = class property MaxMsgSize: Int64 read getMaxMsgSize write setMaxMsgSize; property MulticastHops: Integer read getMulticastHops write setMulticastHops; property IPv4Only: Boolean read getIPv4Only write setIPv4Only; - property LastEndpoint: String read getLastEndpoint; + property LastEndpoint: AnsiString read getLastEndpoint; property KeepAlive: TZMQKeepAlive read getKeepAlive write setKeepAlive; property KeepAliveIdle: Integer read getKeepAliveIdle write setKeepAliveIdle; property KeepAliveCnt: Integer read getKeepAliveCnt write setKeepAliveCnt; property KeepAliveIntvl: Integer read getKeepAliveIntvl write setKeepAliveIntvl; - procedure AddAcceptFilter( addr: String ); - property AcceptFilter[indx: Integer]: String read getAcceptFilter write setAcceptFilter; + procedure AddAcceptFilter( addr: AnsiString ); + property AcceptFilter[indx: Integer]: AnsiString read getAcceptFilter write setAcceptFilter; + + property RouterMandatory: Boolean write setRouterMandatory; {$else} property Swap: Int64 read getSwap write setSwap; property RecoveryIvlMSec: Int64 read getRecoveryIvlMSec write setRecoveryIvlMSec; @@ -481,7 +484,7 @@ TZMQPoller = class( TThread ) fContext: TZMQContext; fOwnContext: Boolean; sPair: TZMQSocket; - fAddr: String; + fAddr: AnsiString; fPollItem: array of zmq.pollitem_t; fPollSocket: array of TZMQSocket; @@ -538,22 +541,12 @@ TZMQPoller = class( TThread ) procedure ZMQTerminate; - // for threadSafe logging to the console. - procedure ZMQNote( str: String ); - implementation var contexts: TList; cs: TRTLCriticalSection; -procedure ZMQNote( str: String ); -begin - EnterCriticalSection( cs ); - Writeln( str ); - LeaveCriticalSection( cs ); -end; - {$ifndef UNIX} function console_handler( dwCtrlType: DWORD ): BOOL; stdcall; forward; {$endif} @@ -922,11 +915,16 @@ procedure TZMQSocket.close; fSocket := nil; end; -procedure TZMQSocket.CheckResult( rc: Integer ); +function TZMQSocket.CheckResult( rc: Integer ): Integer; +var + errn: Integer; begin + result := rc; if rc = -1 then begin - raise EZMQException.Create; + errn := zmq_errno; + if ( errn <> ZMQEAGAIN ) or fRaiseEAgain then + raise EZMQException.Create( errn ); end else if rc <> 0 then raise EZMQException.Create('Function result is not 0, or -1!'); @@ -943,25 +941,25 @@ procedure TZMQSocket.getSockOpt( option: Integer; optval: Pointer; var optvallen CheckResult( zmq_getsockopt( SocketPtr, option, optval, optvallen ) ); end; -procedure TZMQSocket.bind( addr: String ); +procedure TZMQSocket.bind( addr: AnsiString ); begin - CheckResult( zmq_bind( SocketPtr, PAnsiChar( AnsiString( addr ) ) ) ); + CheckResult( zmq_bind( SocketPtr, PAnsiChar( addr ) ) ); end; -procedure TZMQSocket.connect( addr: String ); +procedure TZMQSocket.connect( addr: AnsiString ); begin - CheckResult( zmq_connect( SocketPtr, PAnsiChar( AnsiString( addr ) ) ) ); + CheckResult( zmq_connect( SocketPtr, PAnsiChar( addr ) ) ); end; {$ifdef zmq3} -procedure TZMQSocket.unbind( addr: String ); +procedure TZMQSocket.unbind( addr: AnsiString ); begin - CheckResult( zmq_unbind( SocketPtr, PAnsiChar( AnsiString( addr ) ) ) ); + CheckResult( zmq_unbind( SocketPtr, PAnsiChar( addr ) ) ); end; -procedure TZMQSocket.disconnect( addr: String ); +procedure TZMQSocket.disconnect( addr: AnsiString ); begin - CheckResult( zmq_disconnect( SocketPtr, PAnsiChar( AnsiString( addr ) ) ) ); + CheckResult( zmq_disconnect( SocketPtr, PAnsiChar( addr ) ) ); end; {$endif} @@ -1173,7 +1171,7 @@ procedure TZMQSocket.setIPv4Only( const Value: Boolean ); setSockOptInteger( ZMQ_IPV4ONLY, Integer(Value) ); end; -function TZMQSocket.getLastEndpoint: String; +function TZMQSocket.getLastEndpoint: AnsiString; var s: ShortString; optvallen: size_t; @@ -1224,7 +1222,7 @@ procedure TZMQSocket.setKeepAliveIntvl( const Value: Integer ); setSockOptInteger( ZMQ_TCP_KEEPALIVE_INTVL, Value ); end; -procedure TZMQSocket.AddAcceptFilter( addr: String ); +procedure TZMQSocket.AddAcceptFilter( addr: AnsiString ); begin try setSockOpt( ZMQ_TCP_ACCEPT_FILTER, @addr[1], Length( addr ) ); @@ -1234,14 +1232,14 @@ procedure TZMQSocket.AddAcceptFilter( addr: String ); end; end; -function TZMQSocket.getAcceptFilter( indx: Integer ): String; +function TZMQSocket.getAcceptFilter( indx: Integer ): AnsiString; begin if ( indx < 0 ) or ( indx >= fAcceptFilter.Count ) then raise EZMQException.Create( '[getAcceptFilter] Index out of bounds.' ); result := fAcceptFilter[indx]; end; -procedure TZMQSocket.setAcceptFilter( indx: Integer; const Value: String ); +procedure TZMQSocket.setAcceptFilter( indx: Integer; const Value: AnsiString ); var i,num: Integer; begin @@ -1273,6 +1271,17 @@ procedure TZMQSocket.setAcceptFilter( indx: Integer; const Value: String ); raise EZMQException.Create( num ); end; +procedure TZMQSocket.setRouterMandatory( const Value: Boolean ); +var + i: Integer; +begin + if Value then + i := 1 + else + i := 0; + setSockOptInteger( ZMQ_ROUTER_MANDATORY, i ); +end; + {$else} function TZMQSocket.getSwap: Int64; @@ -1394,68 +1403,72 @@ procedure TZMQSocket.setBacklog( const Value: Integer ); setSockOptInteger( ZMQ_BACKLOG, Value ); end; -procedure TZMQSocket.subscribe( filter: String ); -var - sFilter: AnsiString; +procedure TZMQSocket.subscribe( filter: AnsiString ); begin - sFilter := AnsiString( filter ); - if sfilter = '' then + if filter = '' then setSockOpt( ZMQ_SUBSCRIBE, nil, 0 ) else - setSockOpt( ZMQ_SUBSCRIBE, @sfilter[1], Length( sfilter ) ); + setSockOpt( ZMQ_SUBSCRIBE, @filter[1], Length( filter ) ); end; -procedure TZMQSocket.unSubscribe( filter: String ); -var - sFilter: AnsiString; +procedure TZMQSocket.unSubscribe( filter: AnsiString ); begin - sFilter := AnsiString( filter ); - if sfilter = '' then + if filter = '' then setSockOpt( ZMQ_UNSUBSCRIBE, nil, 0 ) else - setSockOpt( ZMQ_UNSUBSCRIBE, @sfilter[1], Length( sfilter ) ); + setSockOpt( ZMQ_UNSUBSCRIBE, @filter[1], Length( filter ) ); end; {$ifdef zmq3} function TZMQSocket.sendBuffer( const Buffer; len: Size_t; flags: TZMQSendFlags = [] ): Integer; +var + errn: Integer; begin result := zmq_send( SocketPtr, Buffer, len, Byte( flags ) ); if result < -1 then raise EZMQException.Create('zmq_send return value less than -1.') else if result = -1 then - raise EZMQException.Create; + begin + errn := zmq_errno; + if ( errn <> ZMQEAGAIN ) or fRaiseEAgain then + raise EZMQException.Create( errn ); + end; end; {$endif} +// sends the msg, and FreeAndNils it if successful. the return value is the number of +// bytes in the msg if successful, if not returns -1, and the msgs is not discarded. function TZMQSocket.send( var msg: TZMQFrame; flags: Integer = 0 ): Integer; -{$ifdef debug} var - lmsgsize: integer; -{$endif} + errn: Integer; begin {$ifdef zmq3} - {$ifdef debug} - lmsgsize := msg.size; - {$endif} - result := zmq_sendmsg( SocketPtr, msg.fMessage, flags ); //result := zmq_msg_send( msg.fMessage, SocketPtr, flags ); - FreeAndNil( msg ); if result < -1 then raise EZMQException.Create('zmq_sendmsg return value less than -1.') else if result = -1 then - raise EZMQException.Create - else begin - {$ifdef debug} - if result <> lmsgsize then - raise EZMQException.Create('return value of zmq_sendmsg and msg size is not equal.'); - {$endif} - end; + begin + errn := zmq_errno; + if ( errn <> ZMQEAGAIN ) or fRaiseEAgain then + raise EZMQException.Create( errn ); + end else + FreeAndNil( msg ); {$else} result := msg.size; - CheckResult( zmq_send( SocketPtr, msg.fMessage, flags ) ); - FreeAndNil( msg ); + try + if CheckResult( zmq_send( SocketPtr, msg.fMessage, flags ) ) = 0 then + FreeAndNil( msg ) + else + result := -1; + except + on e: Exception do + begin + result := -1; + raise; + end; + end; {$endif} end; @@ -1470,31 +1483,40 @@ function TZMQSocket.send( var msg: TZMQFrame; flags: TZMQSendFlags = [] ): Integ // depending on the flags. function TZMQSocket.send( strm: TStream; size: Integer; flags: TZMQSendFlags = [] ): Integer; var - zmqMsg: TZMQFrame; + frame: TZMQFrame; begin - zmqMsg := TZMQFrame.Create( size ); - strm.Read( zmqMsg.data^, size ); - result := send( zmqMsg, flags ); + frame := TZMQFrame.Create( size ); + try + strm.Read( frame.data^, size ); + result := send( frame, flags ); + finally + if frame <> nil then + frame.Free; + end; end; // send single or multipart message, in blocking or nonblocking mode, // depending on the flags. -function TZMQSocket.send( msg: String; flags: TZMQSendFlags = [] ): Integer; +function TZMQSocket.send( msg: Utf8String; flags: TZMQSendFlags = [] ): Integer; var - sStrm: TStringStream; + frame: TZMQFrame; begin - sStrm := TStringStream.Create( msg ); + frame := TZMQFrame.create; try - result := send( sStrm, sStrm.Size, flags ); + frame.asUtf8String := msg; + result := send( frame, flags ); finally - sStrm.Free; + if frame <> nil then + frame.Free; end; end; +// sends multipart message, the result is the successfully sent frame count. function TZMQSocket.send( var msgs: TZMQMsg; dontwait: Boolean = false ): Integer; var flags: TZMQSendFlags; frame: TZMQFrame; + rc: Integer; begin Result := 0; if dontwait then @@ -1505,64 +1527,81 @@ function TZMQSocket.send( var msgs: TZMQMsg; dontwait: Boolean = false ): Intege begin frame := msgs.pop; if msgs.size = 0 then - send( frame, flags ) + rc := send( frame, flags ) else - send( frame, flags + [sfSndMore] ); - inc( result ); + rc := send( frame, flags + [sfSndMore] ); + if rc = -1 then + begin + result := -1; + break; + end else + inc( result ) end; - FreeAndNil( msgs ); + if result <> -1 then + FreeAndNil( msgs ); end; // send multipart message in blocking or nonblocking mode, depending on the -// dontwait parameter. The return value is the nmber of messages sent. -function TZMQSocket.send( msg: Array of String; dontwait: Boolean = false ): Integer; +// dontwait parameter. The return value is the nmber of messages sent if +// successful, if not return -1, and may raise an exception. +function TZMQSocket.send( msg: Array of Utf8String; dontwait: Boolean = false ): Integer; var - flags: TZMQSendFlags; + msgs: TZMQMsg; + frame: TZMQFrame; + i: Integer; begin - Result := 0; - if dontwait then - flags := [{$ifdef zmq3}sfDontWait{$else}sfNoBlock{$endif}] - else - flags := []; - while result < Length( msg ) do - begin - if result = Length( msg ) - 1 then - send( msg[result], flags ) - else - send( msg[result], flags + [sfSndMore] ); - inc( result ); + msgs := TZMQMsg.create; + try + for i := 0 to Length( msg ) - 1 do + begin + frame := TZMQFrame.create; + frame.asUtf8String := msg[i]; + msgs.add( frame ); + end; + result := send( msgs, dontwait ); + finally + if msgs <> nil then + msgs.Free; end; end; // send multipart message in blocking or nonblocking mode, depending on the -// dontwait parameter. The return value is the nmber of messages sent. +// dontwait parameter. function TZMQSocket.send( msg: TStrings; dontwait: Boolean = false ): Integer; var - flags: TZMQSendFlags; + msgs: TZMQMsg; + frame: TZMQFrame; + i: Integer; begin - result := 0; - if dontwait then - flags := [{$ifdef zmq3}sfDontWait{$else}sfNoBlock{$endif}] - else - flags := []; - while result < msg.Count do - begin - if result = msg.Count - 1 then - send( msg[result], flags ) - else - send( msg[result], flags + [sfSndMore] ); - inc( result ); + msgs := TZMQMsg.create; + try + for i := 0 to msg.Count - 1 do + begin + frame := TZMQFrame.create; + frame.asUtf8String := msg[i]; + msgs.add( frame ); + end; + result := send( msgs, dontwait ); + finally + if msgs <> nil then + msgs.Free; end; end; {$ifdef zmq3} function TZMQSocket.recvBuffer( var Buffer; len: size_t; flags: TZMQRecvFlags = [] ): Integer; +var + errn: Integer; begin result := zmq_recv( SocketPtr, Buffer, len, Byte( flags ) ); if result < -1 then raise EZMQException.Create('zmq_recv return value less than -1.') else if result = -1 then - raise EZMQException.Create; + begin + errn := zmq_errno; + if ( errn <> ZMQEAGAIN ) or fRaiseEAgain then + raise EZMQException.Create( errn ); + end; end; procedure MonitorProc( ZMQMonitorRec: PZMQMonitorRec ); @@ -1597,7 +1636,7 @@ procedure MonitorProc( ZMQMonitorRec: PZMQMonitorRec ); inc( i ); end; zmqEvent.event := TZMQMonitorEvent( i - 1 ); - zmqEvent.addr := String( event.addr ); + zmqEvent.addr := event.addr; zmqEvent.fd := event.fd; ZMQMonitorRec.proc( zmqEvent ); msg.rebuild; @@ -1669,6 +1708,7 @@ function TZMQSocket.recv( var msg: TZMQFrame; flags: Integer = 0 ): Integer; msg := TZMQFrame.Create; if msg.size > 0 then msg.rebuild; + {$ifdef zmq3} result := zmq_recvmsg( SocketPtr, msg.fMessage, flags ); // result := zmq_msg_recv( msg.fMessage, SocketPtr, flags ); @@ -1679,16 +1719,11 @@ function TZMQSocket.recv( var msg: TZMQFrame; flags: Integer = 0 ): Integer; errn := zmq_errno; if ( errn <> ZMQEAGAIN ) or fRaiseEAgain then raise EZMQException.Create( errn ); - end else - begin - {$ifdef debug} - if result <> msg.size then - raise EZMQException.Create('return value of zmq_recvmsg and msg size is not equal.'); - {$endif} end; {$else} - CheckResult( zmq_recv( SocketPtr, msg.fMessage, flags ) ); - result := msg.size; + result := -1; + if CheckResult( zmq_recv( SocketPtr, msg.fMessage, flags ) ) = 0 then + result := msg.size; {$endif} end; @@ -1699,28 +1734,27 @@ function TZMQSocket.recv( msg: TZMQFrame; flags: TZMQRecvFlags = [] ): Integer; function TZMQSocket.recv( strm: TStream; flags: TZMQRecvFlags = [] ): Integer; var - zmqmsg: TZMQFrame; + frame: TZMQFrame; begin - zmqmsg := TZMQFrame.Create; + frame := TZMQFrame.Create; try - result := recv( zmqmsg, flags ); - strm.Write( zmqmsg.data^, result ); + result := recv( frame, flags ); + strm.Write( frame.data^, result ); finally - zmqmsg.Free; + frame.Free; end; end; -function TZMQSocket.recv( var msg: String; flags: TZMQRecvFlags = [] ): Integer; +function TZMQSocket.recv( var msg: Utf8String; flags: TZMQRecvFlags = [] ): Integer; var - sStrm: TStringStream; + frame: TZMQFrame; begin - sStrm := TStringStream.Create(''); + frame := TZMQFrame.Create; try - Result := recv( sStrm, flags ); - sStrm.Position := 0; - msg := sStrm.ReadString( result ); + Result := recv( frame, flags ); + msg := frame.asUtf8String; finally - sStrm.Free; + frame.Free; end; end; @@ -1743,6 +1777,11 @@ function TZMQSocket.recv( var msgs: TZMQMsg; flags: TZMQRecvFlags = [] ): Intege begin msgs.Add( msg ); inc( result ); + end else + begin + result := -1; + msg.Free; + break; end; bRcvMore := RcvMore; end; @@ -1751,21 +1790,16 @@ function TZMQSocket.recv( var msgs: TZMQMsg; flags: TZMQRecvFlags = [] ): Intege // receive multipart message. the result is the number of messages received. function TZMQSocket.recv( msg: TStrings; flags: TZMQRecvFlags = [] ): Integer; var - s: String; - bRcvMore: Boolean; - rc: Integer; + msgs: TZMQMsg; + i: Integer; begin - bRcvMore := True; - result := 0; - while bRcvMore do - begin - rc := recv( s, flags ); - if rc <> -1 then - begin - msg.Add( s ); - inc( result ); - end; - bRcvMore := RcvMore; + msgs := TZMQMsg.Create; + try + result := recv( msgs, flags ); + for i := 0 to result - 1 do + msg.Add( msgs[i].asUtf8String ); + finally + msgs.Free; end; end; @@ -1780,8 +1814,8 @@ constructor TZMQContext.create{$ifndef zmq3}( io_threads: Integer ){$endif}; {$else} fContext := zmq_init( io_threads ); {$endif} - //fLinger := -2; - fLinger := 0; + fLinger := -2; + //fLinger := 0; if ContextPtr = nil then raise EZMQException.Create; fSockets := TList.Create; @@ -1824,7 +1858,7 @@ destructor TZMQContext.destroy; {$else} CheckResult( zmq_term( ContextPtr ) ); {$endif} - fContext := nil; + fContext := nil; end; fSockets.Free; @@ -1836,19 +1870,19 @@ procedure TZMQContext.Terminate; var p: Pointer; begin - fTerminated := true; - - {$ifdef unix} - fTerminated := true; - {$else} - p := ContextPtr; - fContext := nil; - {$ifdef zmq3} - CheckResult( zmq_ctx_destroy( p ) ); - {$else} - CheckResult( zmq_term( p ) ); - {$endif} - {$endif} + if not Terminated then + begin + fTerminated := true; + {$ifndef unix} + p := ContextPtr; + fContext := nil; + {$ifdef zmq3} + CheckResult( zmq_ctx_destroy( p ) ); + {$else} + CheckResult( zmq_term( p ) ); + {$endif} + {$endif} + end; end; procedure TZMQContext.CheckResult( rc: Integer ); @@ -2224,7 +2258,7 @@ procedure AddToRegList( so: TZMQSocket; ev: TZMQPollEvents; reg: Boolean; sync: procedure TZMQPoller.Register( socket: TZMQSocket; events: TZMQPollEvents; bWait: Boolean = false ); var - s: String; + s: Utf8String; begin if fSync then AddToPollItems( socket, events ) @@ -2242,7 +2276,7 @@ procedure TZMQPoller.Register( socket: TZMQSocket; events: TZMQPollEvents; bWait procedure TZMQPoller.DeRegister( socket: TZMQSocket; events: TZMQPollEvents; bWait: Boolean = false ); var - s: String; + s: Utf8String; i: Integer; begin if fSync then @@ -2266,7 +2300,7 @@ procedure TZMQPoller.DeRegister( socket: TZMQSocket; events: TZMQPollEvents; bWa procedure TZMQPoller.setPollNumber( const Value: Integer; bWait: Boolean = false ); var - s: String; + s: Utf8String; begin if fSync then fPollNumber := Value @@ -2358,7 +2392,7 @@ procedure InterruptContexts; i: Integer; begin for i := 0 to contexts.Count - 1 do - TZMQContext(contexts[i]).fTerminated := True; + TZMQContext(contexts[i]).Terminate; end; procedure HandleSignal(signum: longint; si: psiginfo; sc: PSigcontext); cdecl; @@ -2390,9 +2424,9 @@ procedure InstallSigHandler(sig: cint); cdecl; {$else} { - This function is called when a CTRL_C_EVENT received, important that this - function is executed in a separate thread, because Terminate terminates the - context, which blocks until there are open sockets. + This function is called when a CTRL_C_EVENT received, important that this + function is executed in a separate thread, because Terminate terminates the + context, which blocks until there are open sockets. } function console_handler( dwCtrlType: DWORD ): BOOL; var @@ -2413,13 +2447,8 @@ function console_handler( dwCtrlType: DWORD ): BOOL; {$endif} procedure ZMQTerminate; -var - i: Integer; begin - for i := 0 to contexts.Count - 1 do - TZMQContext(contexts[i]).Terminate; - while contexts.Count > 0 do - TZMQContext(contexts[contexts.Count-1]).Free; + GenerateConsoleCtrlEvent( CTRL_C_EVENT, 0 ); end; initialization