Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:32
    srkvenkatesh commented #4388
  • 08:31
    srkvenkatesh opened #4388
  • 08:26
    srkvenkatesh edited #4387
  • 08:26
    srkvenkatesh edited #4387
  • 07:45
    srkvenkatesh commented #4387
  • 07:44
    srkvenkatesh opened #4387
  • May 19 18:53
    bluca commented #4386
  • May 19 18:51
    pjaggi1 commented #4386
  • May 19 18:42
    bluca commented #4386
  • May 19 18:40
    bluca commented #4386
  • May 19 18:36
    pjaggi1 opened #4386
  • May 18 12:33
    TheSirBIG commented #4385
  • May 18 12:33
    TheSirBIG commented #4385
  • May 18 12:31
    TheSirBIG commented #4385
  • May 18 12:25
    TheSirBIG opened #4385
  • May 17 13:13
    EleFontana commented #4274
  • May 17 13:13
    EleFontana commented #4274
  • May 12 08:55

    bluca on master

    Revert "Problem: Libs crash at … Merge pull request #4383 from b… (compare)

  • May 12 08:55
    bluca closed #4383
  • May 11 15:35
    benjdero opened #4384
lofo
@lo-fo
A few days have passed, and i've just successfully used the CLIENT/SERVER sockets on an iOS project with my own serialization logic (not relying on multipart messages anymore). @bv:matrix.org it seems the multi-threaded usage of DEALER/ROUTER socket, although serial, was my issue.
i had to add --enable-draft on the shell script that builds libzmq for iOS. i think it would be a good thing to allow users of this script to toggle it if necessary.
what would be a proper way to implement it, that is compliant with the way zmq is built on other platforms ?
i'd like to make a PR with that
bv
@bv:matrix.org
[m]
I'm not sure I understand the question. "--enable-drafts" argument to libzmq's configure is the appropriate way to build libzmq with support for the "draft" sockets.
here, for example, is how the pyzmq words it. https://pyzmq.readthedocs.io/en/latest/howto/draft.html
lofo
@lo-fo
well, if you want to build libzmq for iOS you have to run ./builds/ios/build_ios.shwhich does not have --enable-drafts on its configure call
since Swift and iOS SDKs burry thread-management at a very low level, my issue is very likely to come up for other iOS projects. DRAFT APIs are handy there.
bv
@bv:matrix.org
[m]
oh, I see. I had never noticed that subdirectory!
lofo
@lo-fo
so my question is, what would be the best way to allow users of ./builds/ios/build_ios.sh to toggle --enable-drafts ?
bv
@bv:matrix.org
[m]
after a brief check of that script, I'd suggest one appropriate thing would be to add a "$CONFIGUREFLAGS" environment variable to the "configure" call so the user can provide the extra --enable-drafts or other options. And, I'd consider setting this new CONFIGUREFLAGS based on a command line argument to the script.
oops, matrix at my underscore. I meant CONFIGURE_FLAGS
lofo
@lo-fo
good, i'll try submitting a PR with that.
bv
@bv:matrix.org
[m]
nice!
Rajan Singh
@spidyDev
Hi all, have a simple question regarding polling and mute state. I am using PUSH-PULL pattern in my cpp application. I want to stop pushing or pulling data if it will result in socket going in "Mute" state. How can i achieve that ? Appreciate the help .
bv
@bv:matrix.org
[m]
hi spidydev. pulling won't cause "mute" state. for pushing you can use a poller and check if the POLLOUT is raised. basically, it checks if the internal buffers have hit the high-water mark (HWM) or not
I've not used it but there is a "non-blocking mode" mentioned in zmq_send man page which gives EAGAIN when the send would block, if I read things correctly
Moldovan Alexandru
@BitByBit1

Hello,

I recently upgraded the zmq library from 4.3.2 to 4.3.4 and I have issues on the setsockopt function.

On 4.3.2
m_commSocket.setsockopt(ZMQ_IDENTITY, ++socketNr);

On 4.3.4 the setsockopt becomes
m_commSocket.set(zmq::sockopt::identity, ++socketNr);

The problem is that the new set() function takes a constant as second parameter.

Does anyone knows how to fix this or how to approach this?

Hendrik
@Asmod4n
That’s c++ code? Libzmq is a c library.
Moldovan Alexandru
@BitByBit1
Yes, the C++ binding for libzmq.
bv
@bv:matrix.org
[m]
the now depreciated setsockopt and the new set both take a templated const T& opt. unless the deprecated function changed signature maybe something else is wrong?
Cassiel-girl
@Cassiel-girl
Can zmq.Context() be called multiple times in the same process context?
bv
@bv:matrix.org
[m]
yes
Cassiel-girl
@Cassiel-girl
Won't duplicate calls lead to wasted resources?
bv
@bv:matrix.org
[m]
I assume you are using pyzmq. The context will be closed once there are on more references to it being held.
Cassiel-girl
@Cassiel-girl
but if I don't close each duplicate calls ?
bv
@bv:matrix.org
[m]
the context object will self close when it destructs which in Python happens when there are no more references to it being held.
Cassiel-girl
@Cassiel-girl
How does zeromq enable reliable transmission from one sender to multiple receivers. pub/sub sockets seem to have packet loss issues, right?
bv
@bv:matrix.org
[m]
No, there is no packet loss on the network because TCP is used. But messages will be lost if the queues in the sockets are allowed to reach their HWM.
message loss occurs first after the receiver queue fills and then the sender queue for that receiver fills. The next message passed to a send() will be dropped.
one can set the HWM to infinity and then message loss will occur once all RAM is exhausted (likely due to your job being killed)
actually there is a second, and common, mode of message "loss". It occurs by sending message too soon right before the initial connection is completed. This is called the "slow subscriber syndrome" and is discussed in the zeromq guide.
Cassiel-girl
@Cassiel-girl
How to set up pub/sub so that all slow receivers will not lose data.
bv
@bv:matrix.org
[m]
barring infinite RAM, if a receiver is slower than a sender eventually messages must be lost
Cassiel-girl
@Cassiel-girl
@bv:matrix.org thank you very much.
Cassiel-girl
@Cassiel-girl

from zmq import Socket
mycontext = zmq.Context()
class MySocket(Socket):

#how to write this class?

sock = MySocket()
sock.xx()

how to implement MySocket to use like socket defined in zmq.

Artur Nebot
@anebot
I've been stuck for some days with some ZQM trouble...
I'm using socket identities to dynamically create the peers.. if packet can't be delivered I create a new peer.
this works fine.. but the problem is that my peers might be destroyed due to inactivity... when it comes back, and I create a new peer with the same identity it seems sender router can't send to the new peer
Artur Nebot
@anebot
thomasjm
@thomasjm:matrix.org
[m]
hello, is there a backup wiki somewhere? the main one at http://wiki.zeromq.org/ seems to be recovering from a hack
bv
@bv:matrix.org
[m]
thomasjm, the wayback machine has some snapshots https://web.archive.org/web/20220311103626/http://wiki.zeromq.org/
I think the content is also on github
thomasjm
@thomasjm:matrix.org
[m]
oh good point, thanks
i looked on github under the zeromq org and didn't see it
bv
@bv:matrix.org
[m]
yeah, I think I was thinking of just the guide which is here https://github.com/booksbyus/zguide
thomasjm
@thomasjm:matrix.org
[m]
i actually have a question i haven't been able to answer in the docs, hoping someone here can help. after you zmq_bind a socket, are you obligated to zmq_unbind it? or is it sufficient to just call zmq_close?
bv
@bv:matrix.org
[m]
I think you can skip the unbind. but I normally work in C++ or python which I guess might do that for me in some destructor
fwiw, the example in the zmq_socket man page has no unbind. it goes straight to zmq_close
thomasjm
@thomasjm:matrix.org
[m]
that's what i figured, i saw that unbind was added to the API somewhat later. i guess unbind is only for when you want to unbind a socket without destroying it, and then bind it again?
bv
@bv:matrix.org
[m]
Seems a likely explanation to me.