IRC Log


Wednesday May 5, 2010

[Time] NameMessage
[05:57] dermoth Hi there... I finally managed to get back at my zmq php ext and I'm adding persisten sockets in there... so what happens when, for a given socket, zmq_connect or zmq_bind is called more then once with the same parameters?
[05:58] dermoth my idea was to keep sockets around when wanted, but then the coerkct might be already connected/bound when those functions gets called (again...)
[06:10] dermoth hi sustrik
[06:10] dermoth I asked a question right before you came in...
[06:10] dermoth <dermoth> Hi there... I finally managed to get back at my zmq php ext and I'm adding persisten sockets in there... so what happens when, for a given socket, zmq_connect or zmq_bind is called more then once with the same parameters?
[06:10] dermoth <dermoth> my idea was to keep sockets around when wanted, but then the socket might be already connected/bound when those functions gets called (again...)
[06:11] sustrik hi
[06:11] dermoth do you have any idea what happens in that case? it doesn'T seem to be documented...
[06:11] sustrik depends on how the underlying transport handle such case
[06:11] sustrik for TCP
[06:12] sustrik rebinding the same nic/port result in EADDRINUSE
[06:12] dermoth so it's not handled at all by zeromq...
[06:12] sustrik it just propagates the error to the user
[06:12] dermoth which means I will have to handle my own persistent connect/binds :(
[06:12] sustrik as for connect, connecting twice means creating 2 TCP connections
[06:12] sustrik probably
[06:13] sustrik have you had a look at mikko's PHP binding?
[06:13] sustrik how does he handle that case?
[06:13] dermoth ok...
[06:13] dermoth humm I had a quick look.. is he supporting persistent sockets?
[06:14] sustrik yes, as far as i know
[06:17] dermoth as far as I can see his code cannot handle multiple persistent sockets though... I made the persistent "flag" a string as to allow multiple apps to run ans use sockets on the same web server without colliding...
[06:17] dermoth looks nice though... I wist I had the time to finish mine...
[06:17] dermoth wish
[06:21] dermoth nevermind thers seems to be an id,,, just passed differently...
[06:24] dermoth so he use a hash for this too... like I would have to do. I can't really compare though as his module is OO asn mine is functionnal... I waven't read much about OO programming in PHP
[06:25] sustrik dermoth: i cannot help much here as I have no idea about PHP
[06:26] sustrik however, try to get in touch with mikko, it may spare you some work
[06:27] dermoth i know... I've speak with him... I didn't know he was writing one when I started, but it was entertaining anyway ;)
[06:43] dermoth sustrik, mikko, fwiw I just make my code available: http://solaris.beaubien.net/cgi-bin/gitweb.cgi/php_zmq.git - as I said I may keep working on it just for fun, but if mikko's modules is stable I might end up using this one (I probably won't finish mine in time if I even finish it...)
[06:44] dermoth just made...
[06:47] sustrik dermoth: i personally would like to see the both efforts joined somehow, if for nothing else a project with 2 contributors is less likely to die...
[06:50] dermoth well I would personally prefer a functional interface but i'm not really going yo use it anyway. I maintain a lot of PHP servers but I never coded much in php - I usually write scripts (and some rare CGIs) in perl or python.
[06:50] dermoth I want to add zeromq to our architecture, but I'm not going to write the code :)
[06:52] dermoth if my module can be useful it's nice... I have absolutely no experience with php extensions though (I read a book on it before writing it...) and it's far from complete
[07:02] sustrik sure :)
[11:04] CIA-15 zeromq2: 03Martin Sustrik 07master * r44dd005 10/ (4 files): number of application threads to use 0MQ sockets is unlimited; app_threads parameter in zmq_init is unused and obsolete - http://bit.ly/acYoiN
[11:04] CIA-15 zeromq2: 03Martin Sustrik 07master * r10f5334 10/ src/signaler.cpp : Merge branch 'master' of git@github.com:sustrik/zeromq2 - http://bit.ly/cCXFzA
[12:24] CIA-15 zeromq2: 03Martin Sustrik 07master * r835e893 10/ (14 files): dispatcher_t class renamed to ctx_t - http://bit.ly/cDh4Vw
[12:33] CIA-15 zeromq2: 03Martin Sustrik 07master * r64c5866 10/ builds/msvc/libzmq/libzmq.vcproj : MSVC build fixed - http://bit.ly/9Mcv5W
[12:35] mikko dermoth: your bsd license contains my name :)
[12:35] mikko in the files
[13:35] dermoth mikko, really?
[13:36] dermoth I though I changed it... did is at 3am though so I might have missed something!
[13:37] dermoth IN NO EVENT SHALL ... BE LIABLE FOR ANY - I didn't think the license itself contained your name :)
[13:42] dermoth Mikko, fixed ;)
[13:44] mikko dermoth: that is "<ENTITY NAME>" in the license
[13:45] dermoth Yes, I used the generic form instead: IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE ...