[zeromq-dev] zeromq Windows handle leak?

2012-12-25 Thread KIU Shueng Chuan
The following snippet seems to be leaking 1 handle per second, as viewed from task manager. OS: Windows XP SP3 32-bits Library: ZeroMQ v3.2.2 - #include zmq.h #include zmq_utils.h int main() { void *ctx = zmq_ctx_new(); while (1) { void *zsock = zmq_socket(ctx,

[zeromq-dev] Why the chat example has been removed from the latest repository ?

2012-12-25 Thread Geek.Song
The ref: http://www.zeromq.org/code:examples-chat Where can I find the chat example source code in the tutorial? Thanks. -- - My key fingerprint: d1:03:f5:32:26:ff:d7:3c:e4:42:e3:51:ec:92:78:b2

Re: [zeromq-dev] Why the chat example has been removed from the latest repository ?

2012-12-25 Thread Pieter Hintjens
That example was very old and removed years ago. Today it's much easier to create a chat program. Here's an example: https://gist.github.com/4373692 -Pieter On Tue, Dec 25, 2012 at 4:43 PM, Geek.Song ffm...@gmail.com wrote: The ref: http://www.zeromq.org/code:examples-chat Where can I find

Re: [zeromq-dev] zeromq Windows handle leak?

2012-12-25 Thread Pieter Hintjens
Opening and closing sockets repeatedly is a very bad idea. Since sockets are in fact closed asynchronously and only finally when you call zmq_ctx_destroy, this code will indeed leak memory. -Pieter On Tue, Dec 25, 2012 at 10:55 AM, KIU Shueng Chuan nixch...@gmail.com wrote: The following

Re: [zeromq-dev] zeromq Windows handle leak?

2012-12-25 Thread KIU Shueng Chuan
Eh? Doesn't the pirate pattern do a close and open? I was referring to a win32 HANDLE leak. I seem to have located the leak. zmq::signaler_t::make_fdpair() opens an Event but fails to CloseHandle it. Adding the CloseHandle, the handle count for the sample program stays constant in task manager.

Re: [zeromq-dev] zeromq Windows handle leak?

2012-12-25 Thread Ian Barber
Actually, I recall a thread previously around make_fdpair on windows - might be worth a quick search of the archives in case this has been subsequently addressed. On 25 Dec 2012 15:44, KIU Shueng Chuan nixch...@gmail.com wrote: Eh? Doesn't the pirate pattern do a close and open? I was

Re: [zeromq-dev] zeromq Windows handle leak?

2012-12-25 Thread Pieter Hintjens
On Tue, Dec 25, 2012 at 5:44 PM, KIU Shueng Chuan nixch...@gmail.com wrote: Eh? Doesn't the pirate pattern do a close and open? Yes, but only in case of failures, which should be rare. I was referring to a win32 HANDLE leak. I seem to have located the leak. zmq::signaler_t::make_fdpair()

Re: [zeromq-dev] Lazy Pirate problems.

2012-12-25 Thread Balázs Varga
Hi Pieter, Yes, the problem is with the Linger option. I didn't set the linger to 0 before closing the socket, Now I see that zsocket_destroy set the linger to 0 (which is the default value of the context) before zmq_close(), however the default linger value of a socket is -1, I thought if I

Re: [zeromq-dev] zeromq Windows handle leak?

2012-12-25 Thread KIU Shueng Chuan
You are right, someone pointed out the CreateEvent leak in make_fdpair() in November but there were no follow ups. http://lists.zeromq.org/pipermail/zeromq-dev/2012-November/019515.html On Dec 26, 2012 12:05 AM, Ian Barber ian.bar...@gmail.com wrote: Actually, I recall a thread previously