[zeromq-dev] [NEWBIE] Delphi wrapper for zeromq and some other issue...
Marcelo Campos Rocha
marcelo at inteq.com.br
Fri Jul 17 20:18:01 CEST 2009
Hi Daniele,
You can submit your Delphi Wrapper, so we make sure it is correct?
Marcelo
2009/7/17 Daniele Teti <d.teti at bittime.it>
> Hi all,
>
>
> I'm a zeromq newbie.
>
> When I start zmq_server.exe (windows Vista or XP) I cannot see any info
> from the server.
> Where are the server logs?
> I've written a small delphi wrapper for zeromq, but client raise an Access
> Violation.
>
> I really need use zeromq from Delphi.
>
> Can someone help me? How I can do some server side debug? and from client
> side?
>
> This is my delphi code
>
> program Test0MQ;
>
> {$APPTYPE CONSOLE}
>
> uses
> SysUtils,
> ZMQ in 'ZMQ.PAS';
>
> var
> _object, data: Pointer;
> message: Pointer;
> msg: string;
> message_size: Int64;
> eid, qid: Integer;
> outtype: UINT32_T;
> begin
> try
> _object := zmq_create('10.5.1.91:5682');
> eid := zmq_create_exchange (_object, 'E', ZMQ_SCOPE_LOCAL, '',
> ZMQ_STYLE_DATA_DISTRIBUTION);
> zmq_bind (_object, 'E', 'Q', nil, 'MyQueue');
> message_size := 4;
> message := GetMemory(message_size);
> StrCat(message, 'ciao');
> zmq_send (_object, eid, message, message_size, ZMQ_TRUE);
> FreeMem(message);
> zmq_destroy(_object);
> WriteLn('Memoria liberata');
> except
> on E:Exception do
> Writeln(e.Message);
> end;
>
> Write('Reading...');
> try
> _object := zmq_create('10.5.1.91:5682');
> qid := zmq_create_queue (_object, 'Q', ZMQ_SCOPE_GLOBAL, '*',
> ZMQ_NO_LIMIT, ZMQ_NO_LIMIT, ZMQ_NO_SWAP);
> zmq_bind (_object, 'E', 'Q', 'MyQueue', nil);
> message_size := 0;
> message := GetMemory(message_size);
> data:=nil;
> zmq_receive(_object, data, message_size, outtype, ZMQ_TRUE);
> FreeMem(message);
> zmq_destroy(_object);
> WriteLn('Memoria liberata');
> except
> on E:Exception do
> Writeln(e.Message);
> end;
> Write('Fine...');
>
>
>
> readln;
> end.
>
>
>
>
> Thanks a lot
>
>
> --
> Daniele Teti
> R&D Director & Educational
> bit Time Softwarewww.bittime.itwww.danieleteti.itwww.codegear.it
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20090717/803c6b51/attachment.htm>
More information about the zeromq-dev
mailing list