ZeroMQ Create Context and Create Socket How Expensive?

How expensive are ZmqContext.Create () and zmqContext.CreateSocket (SocketType.PUB) calls when using ZeroMQ in C # - am I using ZeroMQ 3.2.x for .NET 4.0?

I need to install ZeroMQ Socket and bind (bind) directly to form upload because I will always have at least one ZeroMQ subscriber. Almost all of the ZeroMQ examples complete the context and socket creation in the "using" statement I've seen.

Do I have to worry about being thwarted (closing and deleting) if I don't use the "using" method when the process ends? I don't know that I can guarantee that my _FormClosing or _FormClosed will be deleted as there is no Close field in this Win Form application, it is terminated by another application if it should. This Win Form publisher app typically runs 24x7 with a listener app that runs 24x7.

+3


source to share


1 answer


In general, if you want to know the cost of an operation, just write a small program that does it 1000, 10K, 100K, 1M times and measures the time it takes to start.

Your particular question is a bit special because even if these operations cost nothing, you may run into file descriptors if you open and close them too often.



Most likely your use case will work fine, but you want to emphasize it to make sure what and where it breaks.

+2


source







All Articles