Marked obsolete things obsolete and validated the multithreadet server.
This commit is contained in:
parent
a24e4aa64a
commit
fcd31883f1
|
@ -57,18 +57,19 @@ begin
|
||||||
-- Initialise 0MQ context, requesting a single application thread
|
-- Initialise 0MQ context, requesting a single application thread
|
||||||
-- and a single I/O thread
|
-- and a single I/O thread
|
||||||
Ctx.Set_Number_Of_IO_Threads (Servers'Length + 1);
|
Ctx.Set_Number_Of_IO_Threads (Servers'Length + 1);
|
||||||
|
|
||||||
-- Create a ZMQ_REP socket to receive requests and send replies
|
-- Create a ZMQ_REP socket to receive requests and send replies
|
||||||
Workers.Initialize (Ctx, Sockets.XREQ);
|
Workers.Initialize (Ctx, Sockets.ROUTER);
|
||||||
Workers.Bind ("inproc://workers");
|
Workers.Bind ("tcp://lo:5555");
|
||||||
|
|
||||||
-- Bind to the TCP transport and port 5555 on the 'lo' interface
|
-- Bind to the TCP transport and port 5555 on the 'lo' interface
|
||||||
Clients.Initialize (Ctx, Sockets.XREP);
|
Clients.Initialize (Ctx, Sockets.DEALER);
|
||||||
Workers.Bind ("tcp://lo:5555");
|
Clients.Bind ("inproc://workers");
|
||||||
|
|
||||||
for I in Servers'Range loop
|
for I in Servers'Range loop
|
||||||
Servers (I) := new Server_Task (Ctx'Access, I);
|
Servers (I) := new Server_Task (Ctx'Access, I);
|
||||||
end loop;
|
end loop;
|
||||||
ZMQ.Proxys.Proxy (Frontend => Workers'Access, Backend => Clients'Access);
|
|
||||||
|
ZMQ.Proxys.Proxy (Frontend => Clients'Access,
|
||||||
|
Backend => Workers'Access);
|
||||||
|
|
||||||
end ZMQ.Examples.Multi_Thread_Server;
|
end ZMQ.Examples.Multi_Thread_Server;
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
This folder contains build scripts to install zeromq and libsodium
|
||||||
|
if the distrubution doesent provide a compatibel version of zmq or
|
||||||
|
a compiler different from the distrubutions is used.
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,9 @@
|
||||||
|
|
||||||
with ZMQ.Low_Level;
|
with ZMQ.Low_Level;
|
||||||
with Interfaces.C; use Interfaces.C;
|
with Interfaces.C; use Interfaces.C;
|
||||||
|
with System; use System;
|
||||||
package body ZMQ.Proxys is
|
package body ZMQ.Proxys is
|
||||||
|
--
|
||||||
-----------
|
-----------
|
||||||
-- Proxy --
|
-- Proxy --
|
||||||
-----------
|
-----------
|
||||||
|
@ -46,7 +47,8 @@ package body ZMQ.Proxys is
|
||||||
pragma Unreferenced (Dummy);
|
pragma Unreferenced (Dummy);
|
||||||
begin
|
begin
|
||||||
Dummy := ZMQ.Low_Level.Zmq_Proxy
|
Dummy := ZMQ.Low_Level.Zmq_Proxy
|
||||||
(Frontend.Get_Impl, Backend.Get_Impl, Capture.Get_Impl);
|
(Frontend.Get_Impl, Backend.Get_Impl,
|
||||||
|
(if Capture /= null then Capture.Get_Impl else System.Null_Address));
|
||||||
end Proxy;
|
end Proxy;
|
||||||
|
|
||||||
end ZMQ.Proxys;
|
end ZMQ.Proxys;
|
||||||
|
|
|
@ -44,14 +44,17 @@ package ZMQ.Sockets is
|
||||||
SUB,
|
SUB,
|
||||||
REQ,
|
REQ,
|
||||||
REP,
|
REP,
|
||||||
XREQ,
|
DEALER,
|
||||||
XREP,
|
ROUTER,
|
||||||
PULL,
|
PULL,
|
||||||
PUSH,
|
PUSH,
|
||||||
XPUB,
|
XPUB,
|
||||||
XSUB,
|
XSUB,
|
||||||
STREAM);
|
STREAM);
|
||||||
|
XREQ : constant Socket_Type := DEALER;
|
||||||
|
pragma Obsolescent (XREQ, "use DEALER");
|
||||||
|
XREP : constant Socket_Type := ROUTER;
|
||||||
|
pragma Obsolescent (XREP, "use ROUTER");
|
||||||
type Socket is
|
type Socket is
|
||||||
new Ada.Finalization.Limited_Controlled with private;
|
new Ada.Finalization.Limited_Controlled with private;
|
||||||
type Any_Socket is access all Socket'Class;
|
type Any_Socket is access all Socket'Class;
|
||||||
|
|
Loading…
Reference in New Issue