[Time] Name | Message |
[00:35] rgl
|
zedas, go mongrel go! :-)
|
[04:07] nak
|
hi
|
[04:59] sustrik
|
nak: hi
|
[05:05] guido_g
|
good morning all
|
[05:08] nak
|
sustrik: trying to code an irc bot using zeromq
|
[05:08] nak
|
in c
|
[05:09] nak
|
could you give me any tips on how to set this up
|
[05:09] nak
|
so far i've gotten to the zmq_connect part
|
[05:10] sustrik
|
there's an example that works that way
|
[05:11] sustrik
|
http://github.com/zeromq/zeromq-chat
|
[05:12] nak
|
thanks
|
[05:16] nak
|
sustrik: the s.connect there isn't the same as the one in c
|
[05:16] nak
|
in c you have to send a tcp://address:port
|
[05:16] nak
|
there you just connect?
|
[05:17] sustrik
|
sorry, what are you speaking about?
|
[05:19] nak
|
int zmq_connect (void *socket, const char *address);
|
[05:19] nak
|
where the format has to be rc = zmq_connect (socket, "tcp://server001:5555");
|
[05:19] sustrik
|
yes
|
[05:19] nak
|
ok
|
[05:27] nak
|
zmq::message_t msg (strlen (textbuf) + 1);
|
[05:27] nak
|
memcpy (msg.data (), textbuf, msg.size ());
|
[05:27] nak
|
hnn
|
[05:28] nak
|
so in c this would be zmq_msg_t msg = strlen (textbuf) + 1;
|
[05:28] nak
|
and the memcpy?
|
[05:40] sustrik
|
zmq_msg_t msg;
|
[05:40] sustrik
|
zmq_msg_init_size (&msg, strlen (textbuf) + 1);
|
[05:40] sustrik
|
memcpy (...)
|
[05:51] nak
|
sustrik: http://codepad.org/XGEpa7gw
|
[05:51] nak
|
i don't know the zeromq types, etc
|
[05:51] nak
|
foreign to me.
|
[05:51] nak
|
what should i pass to memcpy
|
[05:51] nak
|
msg.data?
|
[05:53] guido_g
|
http://api.zeromq.org/zmq_msg_init_size.html <- docs
|
[05:53] guido_g
|
http://api.zeromq.org/zmq.html <- even more docs
|
[05:59] nak
|
:)
|
[06:42] umesh
|
how can i build pyzmq with static zmq libraries ...
|
[06:54] sustrik
|
question for brian
|
[06:54] sustrik
|
try asking on mailing list
|
[06:54] umesh
|
ok
|
[08:58] middayc
|
I would like to make a Rebol binding to 0mq .. are there any zmqlib.so / dll available maybe that one could download without recompiling?
|
[09:02] CIA-17
|
zeromq2: 03Martin Sustrik 07master * r9151de3 10/ src/socket_base.cpp : generate identity for transient inproc connections - http://bit.ly/bsKHxn
|
[09:03] sustrik
|
middayc: not that I am aware of
|
[09:03] sustrik
|
however, recompiling takes few seconds
|
[09:03] sustrik
|
well, there are some linux packages out there
|
[09:04] middayc
|
I am on windows now and I don't have VS2008, just VS6 and probably to crappy computer to make VS2008 run well anyway
|
[09:06] sustrik
|
you don't need it to run well
|
[09:06] sustrik
|
it's a very small project
|
[09:06] sustrik
|
so it'll compile even on crappy computer
|
[09:07] middayc
|
last time I tried VS2008 it was horrible.. I will try it again .. ok thanks :) .. just wanted to make sure I am not wasting time downloading and installing visual studio if there is some dll somewhere to try
|
[09:09] sustrik
|
middayc: optionally, it should be compilable under mingw if you have that installed
|
[09:10] middayc
|
I think I have.. I am not too good lower level programmer .. I will try the default way now. if mongrel2 plans work 0mq will get quite some attention :)
|
[09:11] sustrik
|
ok
|
[09:24] middayc
|
ha, I have the dll, I already had vs2008 installed, just didn't have it registered .. I will tell you if I make the rebol binding. Thanks
|
[09:26] middayc
|
I see you also have interprocess communication? so this could be a good option to make for example rebol apps multicore?
|
[09:42] sustrik
|
ipc doesn't work on win32 sadly
|
[09:42] sustrik
|
but using TCP loopback works well
|
[09:42] sustrik
|
e.g: zmq_bind ("tcp://127.0.0.1:5555");
|
[10:58] CIA-17
|
zeromq2: 03Martin Hurton 07master * r4777fe4 10/ src/pipe.cpp :
|
[10:58] CIA-17
|
zeromq2: pipe: fix bug in rollback() method
|
[10:58] CIA-17
|
zeromq2: The msgs_written variable keeps track how many complete
|
[10:58] CIA-17
|
zeromq2: messages have been written so far. The rollback operation drops all
|
[10:58] CIA-17
|
zeromq2: fragments of the last incomplete message so it shouldn't
|
[10:58] CIA-17
|
zeromq2: change this variable at all. - http://bit.ly/9SRCM8
|
[12:53] middayc
|
what would a errno 19 or 22 mean with bind (in .h file when I see errors (if I see correctly) thy should all be above 156384712
|
[13:10] middayc
|
ah, I found strerror
|
[13:11] sustrik
|
middayc: yeah, strerror should help
|
[13:11] sustrik
|
the error you are seeing is probably defined in a system header somewhere
|
[13:18] middayc
|
19 means "no such device" I get -1 and "no such device on zmq-bind sock "tcp://localhost:5555" but 0 and still 19 on zmq-bind sock "tcp://127.0.0.1:5555" ... later with recv I get "Operation cannot be accomplished in current state" but I am not sure if I handle &msg there properly yet (in binding)
|
[13:36] sustrik
|
what's happens when you do zmq_bind ("tcp://127.0.0.1:5555") ?
|
[13:38] middayc
|
I get 0 (but if I call errno anyway it returns "no such device" if it matters)
|
[13:39] sustrik
|
if you get 0 it's OK
|
[13:40] sustrik
|
note that on win32 there are no interface names
|
[13:40] sustrik
|
so you have to bind using an IP address of the interface
|
[13:43] middayc
|
aha, I saw that localhost didn't work.. no problem . I think I am having problem creating and passing that zmq_msg_t struct to init and then recv .. this is completely on my end (rebol's) so I shouldn't bother you about it
|
[13:51] sustrik
|
ok
|
[14:21] middayc
|
I wrote this in rebol chat (it's not so big community) so I guess I will bother you a little more :) .. http://www.qwikitxt.com/use.rsp?key=17-Jun-2010-t2ebk9a6r8ld1c1o4q3z in case you have time you can look at it and if my assumptions are stupidly wrong you can tell me :)
|
[14:37] sustrik
|
middayc: it depends on how rebol handles C objects
|
[14:38] sustrik
|
as a void*?
|
[14:38] sustrik
|
ok, even more essential question:
|
[14:39] sustrik
|
how does rebol wrap C libraries?
|
[14:39] sustrik
|
usign a bridge C library a la JNI
|
[14:39] sustrik
|
or by calling C functions directly from rebol (like .net)?
|
[14:46] middayc
|
http://paste.factorcode.org/paste?id=1734 it's very simple on rebol side, but it has it's limitations.. this is how I specify binding for simpler func ... I talked to some rebol guys and I will write some c code, similarly as lua handles this for example.
|
[14:50] sustrik
|
middayc: yes, the lua way helps as it doesn't require rebol to deal with messy C details (such as sizeof zmq_msg_t)
|
[14:50] sustrik
|
say for implementing send
|
[14:50] sustrik
|
you pass it rebol string (or bytearray or whatevet)
|
[14:50] sustrik
|
the underlying wrapper function (in C) will create zmq_msg_t
|
[14:50] sustrik
|
initialise it and copy the data into it
|
[14:51] sustrik
|
easy
|
[14:53] CIA-17
|
zeromq2: 03Martin Sustrik 07master * r7f01e99 10/ (11 files in 3 dirs): stopwatch returned to libzmq - http://bit.ly/bFfVsS
|
[15:10] CIA-17
|
zeromq2: 03Martin Sustrik 07master * rcff7ba2 10/ (6 files in 6 dirs): Windows build fixed - http://bit.ly/dx2FhU
|
[15:24] middayc
|
thanks for your oppinion.. I will do it that way then. And of course thanks for making 0mq .. what I like the most so far is that it has a minimal simple api
|
[15:31] sustrik
|
middayc: thanks
|
[15:34] middayc
|
(and power with ipc/speed/flexibility/.. I believe powerful things don't have to be bloated and 0mq is that way)
|
[15:36] sustrik
|
actually, bloat is mostly followed by performance degradation
|
[15:40] middayc
|
yes, I think exactly the same way :)
|
[18:41] CIA-17
|
rbzmq: 03Brian Buchanan 07master * r048a024 10/ (zmq2.gemspec zmq.gemspec): rename gem to zmq2 - http://bit.ly/aq9jRH
|