zmsg | small program for sending messages via zcash encrypted memo | Runtime Evironment library

 by   whyrusleeping Go Version: Current License: MIT

kandi X-RAY | zmsg Summary

kandi X-RAY | zmsg Summary

zmsg is a Go library typically used in Server, Runtime Evironment, Ethereum, Nodejs, Discord applications. zmsg has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

zmsg uses the encrypted memo field of zcash sheilded transactions to send messages to other parties. The sent messages get stored in the zcash blockchain and the recipient can check for messages at any time (no need to be online at the same time). Since the messages get stored in the blockchain, they are on every full zcash node. The implication here is that its not possible to tell who the target of any given message is. Currently, each message sends 0.0001 ZEC. You can change this value by setting the --txval flag on sendmsg.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              zmsg has a low active ecosystem.
              It has 91 star(s) with 16 fork(s). There are 9 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 2 open issues and 1 have been closed. On average issues are closed in 385 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of zmsg is current.

            kandi-Quality Quality

              zmsg has no bugs reported.

            kandi-Security Security

              zmsg has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              zmsg is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              zmsg releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed zmsg and discovered the below as its top functions. This is intended to give you an instant insight into zmsg implemented functionality, and help decide if they suit your requirements.
            • getReceivedForAddr gets all received messages for a given address
            • SendMessage sends a message to the remote address
            • readAuthCreds reads username and password from environment variables .
            • WaitForOperation waits for the given operation to be completed .
            • CheckMessages returns all messages that are received
            • getTransaction returns information about a transaction .
            • main is the main entry point
            • checkOperationStatus returns the status of the given op .
            • getMyAddresses returns a list of all connected addresses
            • init the default client
            Get all kandi verified functions for this library.

            zmsg Key Features

            No Key Features are available at this moment for zmsg.

            zmsg Examples and Code Snippets

            No Code Snippets are available at this moment for zmsg.

            Community Discussions

            QUESTION

            Connecting to device with ZeroMQ stream fails, but Linux Sockets work
            Asked 2018-Aug-09 at 19:35

            I have a serial device that is being converted to TCP/IP through a serial server. This seems to work correctly as other applications can connect this way.

            In my application, I'm trying to use ZeroMQ ZMQ_STREAM to send a request for information to the device, and wait for a reply.

            ...

            ANSWER

            Answered 2018-Aug-03 at 22:02

            Using ZMQ_STREAM is a little tricky, but you should be able to use a single socket to communicate with an external TCP socket.

            One disclaimer, I'll show examples using zmqpp library, but key point is not exact functions to call but rather how to correctly apply flow, so I hope you will be able to transform it to pure ZeroMQ.

            Take a look at zmq api docs, Native pattern paragraph.

            To initiate the connection with remote, after connect you need to obtain ZMQ_IDENTITY.

            To open a connection to a server, use the zmq_connect call, and then fetch the socket identity using the ZMQ_IDENTITY zmq_getsockopt call.

            Source https://stackoverflow.com/questions/51544650

            QUESTION

            Czmq memory leakage in a simple PUB / SUB application
            Asked 2018-Jun-07 at 20:24

            I am facing a memory leakage issue while using czmq library for a simple PUB / SUB application. So, here is the description:

            The setup contains multiple publishers and multiple subscribers. Each publisher and subscriber is a separate thread. Threads are normal POSIX threads on a Linux machine. I am sending messages from the publisher to subscriber using zmsg_send and zframe. Each message containing one frame each. I am able to send and receive messages, but over time I am seeing memory occupied by the application increases. I am using tcp pub-sub sockets.

            One thing I would like to mention is that after sending the message I am not destroying it as it is mentioned in the documentation that it will.destroy them after sending successfully. While receiving the message I copy the received message into a local structure and then I destroy the frame and zmsg. I am using zpoller to wait on the socket for messages. It's running on an arm processor. Could anyone please guide me towards, what things I need to keep in mind to avoid the memory leakage? The Application sends messages at the rate of 10 Hz.

            And clue on the general mistakes that I might be making will be helpful. Thanks.

            ...

            ANSWER

            Answered 2018-Jun-07 at 20:24

            You need to dig further to work out what is leaking the memory.

            Run your application under valgrind, once you are at the point you think the memory is being leaked, break the execution and valgrind should report all possible leaks. Hopefully the real leak should stand out as it will be large and obvious.

            Other things to try would be reducing the HWM's to 1 for all sockets and see if that makes a difference. It could be that the memory leak is just ZeroMQ using the buffers (set by HWM). Linux will not always return the memory to the heap if its freed unless it is needed elsewhere.

            Finally thanks to ZeroMQ's architecture you could very easily split your application into two, then your PUB and SUB would be separate and narrow down the leak further.

            Source https://stackoverflow.com/questions/50689447

            QUESTION

            ZeroMQ async multithreading with ROUTER and DEALER
            Asked 2018-Apr-04 at 04:35

            I want to know if there's a way for a ZeroMQ socket to do only reading or only writing. Because, it seems to me that, even though there are async/multithreading examples, every thread still uses recv-then-send loop. The problem I have is, I want to have receiveMessage() that reads from ZeroMQ socket and sendMessage(msg) that writes to ZeroMQ socket. But each of those methods would run in separate thread that is constructed IN ANOTHER class. Here's my code (I'm using jeromq from Scala):

            ...

            ANSWER

            Answered 2018-Mar-17 at 00:07
            Is there a way for a ZeroMQ socket to do only reading or only writing?

            Yes, several ways.

            a ) use a tandem of simplex archetypes: PUSH/PULL writes and PULL/PUSH reads
            b ) use a tandem of simplex archetypes: (X)PUB/(X)SUB writes and (X)SUB/(X)PUB reads

            ... still uses .recv()-then-.send() loop.

            Well, this observation is related more to the actual socket-archetype, some of which indeed require a mandatory two-step ( hardwired inside their internal FSA-s ) sequencing of .recv()--.send()--...

            ... but each of those methods would run in separate thread

            Well, here the challenge starts: ZeroMQ was since its initiation designed as principally zero-sharing so as to foster performance and independence. Zen-of-Zero is interesting design principle in distributed-system design.

            Yet, recent re-design efforts have presented in API 4.2+ a will to achieve ZeroMQ socket Access-points to become thread-safe ( which goes against the initial principle of share-nothing ), so if going to experiment in this direction, your may arrive in territories, that work, but at a cost of decline from Zen-of-Zero.

            ZeroMQ Socket Access-point(s) should never be shared, even if possible, because of design purity.

            Better equip such class with another pair of simplex PUSH/PULL-s, if you strive for separation of OOP-concerns, but your head-end(s) of such read-only-specialised + write-only-specialised sockets will have to handle the cases, when a "remote" ( beyond the foreign class-boundary of abstraction ) ZeroMQ Socket-archetype FSA and it's settings and performance tweaking and error-state(s) and the "remote" class will have to arrange all such plus mediate all message-transfers to/from the native ZeroMQ-socket ( which is principally isolated and hidden for both of the head-end ( specialised ) classes ).

            In any case, doable with due design care.

            ZeroMQ resources are not any cheaply composable / disposable trash

            An idea of:

            Source https://stackoverflow.com/questions/49329294

            QUESTION

            How to solve an Error while sending a structure containing an array using ZeroMQ in C++
            Asked 2018-Feb-11 at 16:37

            A client sends a structure ( containing an array ) to a server ten times. Servers job is to receive this structure and to print it. But it receives the structure only once and prints it and exits giving this error
            "terminate called after throwing an instance of 'zmq::error_t'".

            This is the client C++ code:

            ...

            ANSWER

            Answered 2018-Feb-11 at 16:36
            Better use a PUSH/PULL of an XREQ/XREP,
            as the original REP/REQ enforces a strict chain of .send()-.recv()-.send()-.recv()- ...

            If your needs are exactly as expressed above, a just a change of the ZeroMQ Scalable Formal Communication Archetype pattern is enough.

            If you opt to keep as close as possible to the REQ/REP "similarity", use XREQ/XREP, if having more to say and planning for some further extending the distributed signalling/messaging services infrastructure, better use a tandem of single-direction hoses C->S + S->C using a pair of PUSH/PULL + PUSH/PULL.

            A PAIR/PAIR might be an option if a messaging paradigm can live with just one, exclusive, pair of nodes, where PAIR/PAIR ( as implemented ) does not provide a way to later expand to .connect() into N:1 or 1:M or N:M peer-nodes framework.

            Source https://stackoverflow.com/questions/48733059

            QUESTION

            Send data in multiple ways depending on how you want to send it
            Asked 2018-Jan-19 at 22:54

            I have bunch of keys and values that I want to send to our messaging queue by packing them in one byte array. I will make one byte array of all the keys and values which should always be less than 50K and then send to our messaging queue.

            Packet class:

            ...

            ANSWER

            Answered 2018-Jan-11 at 08:24

            I don't see the definition of sender in Packet. I assume it is defined as a private instance variable?

            The design indeed needs to be fixed. By having the Packet class do the sending, the design violates the Single responsibility principle. There should be a separate (possibly abstract) class that prepares the data to be sent (prepares a java.nio.Buffer instance) and it can have one or more sub classes, one of which returns a java.nio.ByteBuffer instance.

            A separate class that gets a Buffer and performs the sending. This (possibly abstract) class can have sub classes for the different sending platforms and methods.

            then, you need another class that implements the Builder pattern. Clients that wish to send packets, use the builder to specify concrete Packet and Sender (and possibly other needed properties, like a socket number) and then call send() that does the sending.

            Source https://stackoverflow.com/questions/48201935

            QUESTION

            Send record and wait for its acknowledgement to receive
            Asked 2017-Dec-20 at 12:37

            I am using below class to send data to our messaging queue by using socket either in a synchronous way or asynchronous way as shown below.

            • sendAsync - It sends data asynchronously without any timeout. After sending (on LINE A) it adds to retryHolder bucket so that if acknowledgement is not received then it will retry again from the background thread which is started in a constructor.
            • send - It internally calls sendAsync method and then sleep for a particular timeout period and if acknowledgement is not received then it removes from retryHolder bucket so that we don't retry again.

            So the only difference between those two above methods is - For async I need to retry at all cost but for sync I don't need to retry but looks like it might be getting retried since we share the same retry bucket cache and retry thread runs every 1 second.

            ResponsePoller is a class which receives the acknowledgement for the data that was sent to our messaging queue and then calls removeFromretryHolder method below to remove the address so that we don't retry after receiving the acknowledgement.

            ...

            ANSWER

            Answered 2017-Dec-20 at 12:37

            The code has a number of potential issues:

            • An answer may be received before the call to retryHolder#put.
            • Possibly there is a race condition when messages are retried too.
            • If two messages are sent to the same address the second overwrites the first?
            • Send always wastes time with a sleep, use a wait+notify instead.

            I would store a class with more state instead. It could contain a flag (retryIfNoAnswer yes/no) that the retry handler could check. It could provide waitForAnswer/markAnswerReceived methods using wait/notify so that send doesn't have to sleep for a fixed time. The waitForAnswer method can return true if an answer was obtained and false on timeout. Put the object in the retry handler before sending and use a timestamp so that only messages older than a certain age are retried. That fixes the first race condition.

            EDIT: updated example code below, compiles with your code, not tested:

            Source https://stackoverflow.com/questions/47113466

            QUESTION

            ZeroMQ blocked in a context.term() call. Why? How to prevent?
            Asked 2017-Sep-04 at 14:47

            I have a java program that using ZeroMQ.

            But I found the program blocked in context.term(); if receiving a message( recvMsg() ) time out!

            ...

            ANSWER

            Answered 2017-Sep-04 at 05:31

            According to the API, http://api.zeromq.org/4-2:zmq-term, it will block when there's still messages to transmit. This suggests that you other machine or process, the one that will open the REP socket; isn't running.

            Source https://stackoverflow.com/questions/46029965

            QUESTION

            Is ZeroMQ server listening infinitely?
            Asked 2017-Jan-28 at 19:08

            I am trying to implement client server using ZeroMQ.

            I am running a server in an infinite loop, bound to a socket and polling the the socket infinitely.

            When a client sends a request, the server receives only for the first time. The subsequent requests are not received by the server, below is my code snippet

            Server :

            ...

            ANSWER

            Answered 2017-Jan-28 at 19:08

            A REP socket must send a reply before it can receive again. If you're just wanting a 1 way communication you might be better using a PUB & SUB.

            Source https://stackoverflow.com/questions/41829401

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install zmsg

            First, make sure you have [go](https://golang.org/doc/install) installed, then:.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/whyrusleeping/zmsg.git

          • CLI

            gh repo clone whyrusleeping/zmsg

          • sshUrl

            git@github.com:whyrusleeping/zmsg.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link