Re: [zeromq-dev] memory leak or heap problem in czmq on Windows build

2014-04-01 Thread Ivan Pechorin
2014-04-02 19:10 GMT+13:00 Pritesh Acharya : > Hi, > zmq version: zeromq-4.0.3(build as Windows DLL) > czmq version: czmq-2.0.3(build as Windows DLL) > IDE: Visual Studio Professional 2010 > > I have a small progream which creates two thread and uses ZMQ_PAIR socket > over inproc to send data from

Re: [zeromq-dev] czmq: Error Traceability with assert(...) and release code

2014-03-10 Thread Ivan Pechorin
assert() gives you a core dump that has complete context, including stack trace. How do you propose to provide the same, if you replace assert with return? On 11/03/2014 12:10 AM, "Christoph Zach" wrote: > On Monday 10 March 2014 10:36:22 Pieter Hintjens wrote: > > This theory is fine in theory.

Re: [zeromq-dev] Need 100K+ IPC sockets

2014-02-26 Thread Ivan Pechorin
2014-02-27 12:52 GMT+13:00 Matt Connolly : > > You may be right, but from what I can see in the socketpair man pages, > it's just a pipe, and not bound to a particular IP network, so there may > not be any 16-bit port number limitation. It looks to me like the only > limits are those on the number

Re: [zeromq-dev] Need 100K+ IPC sockets

2014-02-25 Thread Ivan Pechorin
Correct me if I'm wrong here, but I suspect you can't create more than 64K of ZeroMQ sockets on a single non-Linux box just because every ZeroMQ socket has a socketpair, which occupies one ephemeral port. Total number ports is limited to 64K on any single box. On Linux ZeroMQ uses eventfd instead

Re: [zeromq-dev] How to build zeromq on AIX?

2014-01-22 Thread Ivan Pechorin
Hello! Hello, this is my first time to use zeromq and I get a problem on building > the zeromq on AIX. > > I download the file 'zeromq-4.0.3.tar.gz' and put it on AIX. Then I use > the following command to build it. > > ./configure CC=xlc CXX=xlC > make > > Compile is OK. But when I use 'make chec

Re: [zeromq-dev] How to build zeromq on AIX?

2014-01-21 Thread Ivan Pechorin
Hello Hello, this is my first time to use zeromq and I get a problem on building the zeromq on AIX. I download the file 'zeromq-4.0.3.tar.gz' and put it on AIX. Then I use the following command to build it. ./configure CC=xlc CXX=xlC make Compile is OK. But when I use 'make check' to check it, I

Re: [zeromq-dev] When unreliability is desired

2013-12-04 Thread Ivan Pechorin
UDP support was reverted in libxs just before 1.2.0 release: check the commits history on github around June 13th, 2012. 05.12.2013 6:48 пользователь "Lindley French" написал: > Can you clarify where in the Crossroads IO library the UDP transport code > lives? I've downloaded the 1.2.0 tarball he

Re: [zeromq-dev] zmq_poll stops expiring timeout in virtualized Windows 7

2013-11-06 Thread Ivan Pechorin
Felipe, > We can make our own GetTickCount64 built around GetTickCount and call it when GetTickCount64 is not available in Kernel32.dll. This code supports Windows 2000 or greater, whereas calling GetTickCount64 directly from Kernel32.dll supports only Vista or greater. > > static DWORD s_wrap = 0

Re: [zeromq-dev] Version 4.0 release fork

2013-09-24 Thread Ivan Pechorin
2013/9/24 Pieter Hintjens > On Mon, Sep 23, 2013 at 3:56 AM, Steven McCoy > wrote: > > > MSVC2008 is broken due to inttypes.h dependency. > > Where is that dependency? I can't find it. zmq_utils.h included , which is not available in MSVC2008. I've created an issue in zeromq4-x and sent pull

Re: [zeromq-dev] JeroMQ crashes application

2013-08-13 Thread Ivan Pechorin
> There is a method in the class where 1) the context is retrieved, 2) a socket created, 3) message published and 4) socket closed. Socket close command is processed asynchronously by reaper thread, and it seems like you don't give it enough time to release resources. Creating/destroying a socket

Re: [zeromq-dev] What C++ bindings to use ?

2013-05-29 Thread Ivan Pechorin
2013/5/29 Michael Haberler : > that leaves me guessing which zmq api I should use assuming I switch to C++ > for that application: using the CZMQ C API in a C++ program, which calls upon > the C++ binding indirected through the C layer strikes me as a bit awkward; > or using the C++ binding dir

Re: [zeromq-dev] zeromq build in the HP-UX question

2013-05-24 Thread Ivan Pechorin
2013/5/24 AJ Lewis : > On Fri, May 24, 2013 at 03:28:29PM +0200, Bjorn Reese wrote: >> On 05/24/2013 10:38 AM, zhabh wrote: >> >> > *the build machine is :**HP-UX yysdf B.11.31 U ia64 3962423388 * >> > *the tar pkg is **zeromq-3.2.3*** >> > *the compile is :**aCC: HP C/aC++ B3910B A.06.22* >> [...]

Re: [zeromq-dev] ZeroMQ in AIX: native base compiled ok / java bindings fail

2013-03-13 Thread Ivan Pechorin
Hi Gonzalo, the only extra needed step was to force the use of IBM's XLC C++ compiler > by issuing the following statement: > > export CXX=xlc > > > Now I have the couple of files corresponding to the base zmq native > libraries (libzmq.a and libzmq.la). > > Tried the same procedure with the zmq J

Re: [zeromq-dev] First try - Java client, CPP server

2013-02-13 Thread Ivan Pechorin
Besides the zeromq usage issue(s), you have charset encoding mismatch. outData.getBytes() returns your string in UTF-16 encoding. When you receive this byte buffer in your CPP server, you just pass it to constructor of std::string that accepts it until the first 0 byte. In case of latin text encod

Re: [zeromq-dev] Question for java users

2013-02-07 Thread Ivan Pechorin
Hi John, 2013/2/7 John Watson : > Quick question for those of you out there who use 0mq from java. > > Do you use the jzmq ZLoop, and if so, what is an example use case? I use JeroMQ ZLoop for polling 0mq sockets (PollItems with IZLoopHandlers) and for timers. Single thread. > (This is specific

Re: [zeromq-dev] A discussion about consolidating jeromq namespace with jzmq

2013-01-26 Thread Ivan Pechorin
Hello, > I want to listen opinions from community about consolidating JeroMQ namespace > with jzmq. > I hope JeroMQ to be inter-changible with jzmq just by changing the jar file. It seems like this would potentially 1) increase test coverage for both projects, 2) simplify preparing minimal tes

Re: [zeromq-dev] Error: comparison between signed and unsigned integer expressions

2012-07-05 Thread Ivan Pechorin
2012/7/5 Pieter Hintjens > Hi Sharon, > > OK, so socklen_t is definitely signed on your platform. If you would > make an issue in Jira, I'll make a patch for all current 0MQ versions. > > Android NDK has the following typedef: typedef int socklen_t I wonder why they choose to go against UNIX sp

Re: [zeromq-dev] How to safely use a socket in multiple threads in zmq 2.1.11

2012-07-04 Thread Ivan Pechorin
2012/7/5 Stephen Hemminger > > You can have a per-thread pool of sockets, but you can't create socket > in one thread and then use it in another. You CAN create in one thread and then use it in another - just ensure there's a memory barrier in the middle. > Can you just have one socket > per

Re: [zeromq-dev] How to safely use a socket in multiple threads in zmq 2.1.11

2012-07-04 Thread Ivan Pechorin
2012/7/5 Thiago Cangussu > > The question is: what should I do to make this multi-threaded usage of > sockets safe? Is it enough to guarantee that multiple threads do not > perform send/receive simultaneously? > > This is already in the FAQ [1]: "For those situations where a dedicated socket per

Re: [zeromq-dev] czmq head failing against libzmq head

2012-06-24 Thread Ivan Pechorin
2012/6/24 Brian Knox > zsockopt.c: In function 'zsocket_set_fail_unroutable': > zsockopt.c:970:38: error: 'ZMQ_FAIL_UNROUTABLE' undeclared (first use in > this function) > zsockopt.c:970:38: note: each undeclared identifier is reported only once > for each function it appears in > this option wa

Re: [zeromq-dev] (py)zmq, fork and cloexec

2012-06-20 Thread Ivan Pechorin
2012/6/20 Christian Heimes > You'd have to register all file descriptors in a > central registry, remove the FDs on close and close() the FDs after > fork(). That's lots of work but C++ should make it easie > > Sounds too complex: why not just close() all the FDs >= 3 after fork(), before exec*()

Re: [zeromq-dev] SEHException when calling zmq_init from clrzmq

2012-06-18 Thread Ivan Pechorin
2012/6/18 Tom Robinson > > If you are sure that you have the C/C++ runtime libraries installed on > this machine (for the same version of MSVC that was used to build > libzmq.dll), you could try to remote attach to the IIS process from Visual > Studio and see the actual call stack at the moment

Re: [zeromq-dev] SEHException when calling zmq_init from clrzmq

2012-06-18 Thread Ivan Pechorin
2012/6/18 Tom Robinson > > Unfortunately the ErrorCode is -2147467259 (i.e. not set?) and there’s no > further information available through the debugger. > -2147467259 is E_FAIL If you are sure that you have the C/C++ runtime libraries installed on this machine (for the same version of MSVC th

Re: [zeromq-dev] Static link

2012-06-14 Thread Ivan Pechorin
Hi Xavier I would like to do a dll for windows 32 (for my project), and doing a > static link with libzmq.lib. > > I compile the solution zeromq-3.2.0 with: > > ** ** > > > > I try this, directly in the zmq.h: > > __declspec(dllexport) int zmq_bind (void *s, const char *addr); > > ** *

Re: [zeromq-dev] Code-style question

2012-05-23 Thread Ivan Pechorin
2012/5/23 Marco Trapanese When you have to send commands, do you use a fields to represent the > enum of the desired command and the others the parameters, don't you? > Yes ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org

Re: [zeromq-dev] Code-style question

2012-05-22 Thread Ivan Pechorin
2012/5/23 Marco Trapanese > > But the examples exchange messages with fun payloads, like these: > > - "hello" / "world" > - "I'm ready" > - "ok" > - "We don't want to see this" > - "This is the workload" > > or just a counter to simulate some data. > > I'm asking what you actually send in your me

[zeromq-dev] Build fails on Solaris / Sun C++: multimap::insert in socket_base.cpp:550

2012-05-20 Thread Ivan Pechorin
Hello! libzmq master fails to compile with Sun C++ on Solaris. I used just ./autogen.sh && ./configure && gmake The error is: "socket_base.cpp", line 550: Error: Could not find a match for std::multimap, std::allocator>>::insert(std::pair) needed in zmq::socket_base_t::add_endpoint(const char*,

Re: [zeromq-dev] ZeroMQ question

2012-05-05 Thread Ivan Pechorin
2012/5/4 Philippe MESLIN > If we run the following code: > The code in your email seems broken to me and should not compile. Please, try to copy-paste something that at least compiles. > zmq_rc zmq_msg_init_data = (& request, "Hello My Size is EQUAL TO 29 <", > sizeof ("Hello My Size is EQU

Re: [zeromq-dev] linking to a static 0MQ 2.2.0 library in VS10

2012-04-29 Thread Ivan Pechorin
2012/4/29 Jonathan Livni > I'm trying to build a 0MQ C++ > example using > VS10 and ZeroMQ 2.2.0. > > I downloaded the windows sources > and > tried to follow these > instructions

Re: [zeromq-dev] zeromq licensing forbidden at my company

2012-04-23 Thread Ivan Pechorin
2012/4/23 Aaron Watters I just started a new job where I had hoped to use zeromq > but I discovered that zeromq is listed on the internal "forbidden" > list because of issues with LGPL. There may be political ways > around this as far as I know, but just to ask... > By the way, what are the iss

Re: [zeromq-dev] Thread-safe sockets (cont.)

2012-02-16 Thread Ivan Pechorin
On 17.02.2012, at 3:32, john skaller wrote: > On 17/02/2012, at 9:05 AM, Chuck Remes wrote: > >> On Feb 16, 2012, at 3:51 PM, Pieter Hintjens wrote: >>> >> >> zmq_poll() would probably need to be modified to disallow multiple threads >> from polling. Alternately, zmq_poll() would need to di

Re: [zeromq-dev] atomic ops

2012-02-08 Thread Ivan Pechorin
2012/2/8 Steven McCoy : > > Compare with my atomics: > > http://code.google.com/p/openpgm/source/browse/trunk/openpgm/pgm/include/pgm/atomic.h Steven, what is the reason to use asm on Solaris/x86 instead of Solaris intrinsics from ? #elif (defined( __SUNPRO_C ) || defined( __SUNPRO_CC )) && (def

Re: [zeromq-dev] does 0mq keep-alive for connections?

2012-01-23 Thread Ivan Pechorin
2012/1/23 Martin Sustrik : > On 22/01/12 13:02, Sergey Matveychuk wrote: > >> I think the patch will resolve my problem. > > Are you sure about that? > > First, keepalives are meant for the situation where the network > connectivity between peers is broken (cable pulled out from the socket, > switc

Re: [zeromq-dev] errno

2012-01-14 Thread Ivan Pechorin
2012/1/15 john skaller : > There's also an issue with atomicity (is that a word?). > Doing something THEN fetching the result in a separate operation > is dangerous. What happens if there's a context switch in between? > > OK, so it can't be a pthread .. but what about a signal, or, in my case, >

Re: [zeromq-dev] zmq_msg_t and zmq_msg_close() - lifetime of this structure

2012-01-09 Thread Ivan Pechorin
2012/1/9 Marten Feldtmann : > "The zmq_msg_close() function shall inform the ØMQ infrastructure that > any resources associated with the message object referenced by msg are > no longer required and may be released. Actual release of resources > associated with the message object shall be postpone

Re: [zeromq-dev] NYSE OpenMAMA

2011-11-02 Thread Ivan Pechorin
2011/11/2 Ciprian Dorin Craciun : >    Now maybe this is a little off-topic -- although the initial > developers of ZeroMQ also developed the first version of AMQP (if I > recall correctly???) -- but here it goes... :) > >    Now when I've first seen AMQP I've said: "finally a protocol which > is b

Re: [zeromq-dev] PUB/SUB socket result in server's crash

2011-07-19 Thread Ivan Pechorin
2011/7/19 yy l : > Attachment is my test code. > Client is connecting and disconnecting continuously. The phenomenon is that > memory of server is growing, and finally zmq::mailbox_t:: send (const > command_t &cmd_) function arise an error, nbytes = -1, WSAGetLastError() > return 10053. You "test

Re: [zeromq-dev] zmq_msg_init_data with zero deallocation function

2011-05-11 Thread Ivan Pechorin
2011/5/11 Dirkjan Ochtman : >> Is the code >> == >> zmq_msg_t msg; >> zmq_msg_init_data (&msg, (void *)"something", 9,  NULL, NULL); >> == >> valid? > > I think in this case "something" is allocated on the stack. It's more likely that it will be kept in read-only data section, not on stack. Theref

Re: [zeromq-dev] Important: backward incompatible changes for 0MQ/3.0!

2011-03-28 Thread Ivan Pechorin
Hi Gonzalo! 2011/3/28 gonzalo diethelm : > Another crazy hack suggestion: if you change the representation of context to > also be an integer handle, you could encode the {context, socket} pair as two > 16 bit (unsigned) integers packed into a 32 bit (unsigned) integer.   > Advantages: How wou

Re: [zeromq-dev] IPC on Windows (again)

2011-03-22 Thread Ivan Pechorin
Hi Marcelo, 2011/3/22 Marcelo Cantos : > MartinL: The zpmd solution doesn't require a service. Erlang nodes start > epmd on-the-fly when they detect that it isn't running, and it runs forever > from that point on. This does, of course, require a zpmd.exe to be sitting > around in easy reach, and

Re: [zeromq-dev] Daily builds update

2011-02-08 Thread Ivan Pechorin
Hi Martin, Hi Mikko > If you have a box with different CPU (SPARC, PPC, Itanium etc.) or OS > (OSX, AIX, HP-UX etc.) available, help us to make 0MQ as robust as > possible and volunteer for running a slave build on your system! Is it possible to run a slave on a machine that is behind HTTP prox

Re: [zeromq-dev] c struct as a zmq message

2011-01-07 Thread Ivan Pechorin
On 07.01.2011, at 16:56, Martin Sustrik wrote: > On 01/07/2011 02:36 PM, Daniel Cegiełka wrote: > >> I use only c/c++ on linux :) > > Say the endianness depends on the processor. Using C/C++ or Linux > doesn't affect it in any way. On the same Intel Itanium2 processor Linux is little-endian

Re: [zeromq-dev] [2.1.0] Problems with lruqueue from The Guide (tm)

2010-12-08 Thread Ivan Pechorin
2010/12/8 Steven McCoy : > the client hangs in zmq_term unless you modify the code to close each 0MQ > socket before closing the thread By the way, closing a thread that created a 0MQ socket is not a good idea due to memory leaks. On Linux, each thread leaks 54 bytes of memory on close. 0MQ 2.

Re: [zeromq-dev] Static library in Visual Studio

2010-11-07 Thread Ivan Pechorin
2010/11/7 Joshua Foster : > You need to set the Runtime library to MT instead of MD. Sorry, but this is just plain wrong: switching MD to MT will link the runtime libraries statically into the 0MQ library, but won't link 0MQ itself as a static library instead of DLL. __

Re: [zeromq-dev] Any progress on 64-bit Windows build

2010-10-04 Thread Ivan Pechorin
Hi Steven, 2010/10/4 Steven McCoy : > Native wide character support is complicated, > MSVC forwards on _NATIVE_WCHAR_T_DEFINED > but without the conversion APIs data structures > that have defined WCHAR member variables are unusable? > I need a multi-byte string value of MIB_IFROW::wszName. I bel

[zeromq-dev] question about zmq_poll() with timeout on Windows

2010-02-09 Thread Ivan Pechorin
Hi I'm trying to implement a loop with zmq_poll() on a single ZMQ_REP socket, and non-zero timeout set, and always get the following error: Assertion failed: Invalid argument (..\..\..\src\zmq.cpp:514) Here is the minimal piece of code to reproduce the problem: #include int main(int argc, ch