[zeromq-dev] [NEWBIE] Delphi wrapper for zeromq and some other issue...

Daniele Teti d.teti at bittime.it
Fri Jul 17 12:11:26 CEST 2009


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 Software
www.bittime.it
www.danieleteti.it
www.codegear.it

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.zeromq.org/pipermail/zeromq-dev/attachments/20090717/eaa19e3a/attachment.htm 


More information about the zeromq-dev mailing list