zsocket | Zero-copy sockets for Linux in Golang | Networking library

 by   newtools Go Version: Current License: MIT

kandi X-RAY | zsocket Summary

kandi X-RAY | zsocket Summary

zsocket is a Go library typically used in Networking applications. zsocket has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

ZSocket is a library that wraps the linux zero-copy socket syscall to create a ring buffer in a memory mapped file. It also contains some utility functions and types to help with a handful of layer 2, 3, and 4 types. It is a lot like libcap, except it has easy to understand facilities for writing (injecting packets) to an interface. ZSocket doesn't contain or wrap any C/C++, and it is lock free and thread safe.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              zsocket has a medium active ecosystem.
              It has 821 star(s) with 72 fork(s). There are 30 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 8 open issues and 2 have been closed. On average issues are closed in 132 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of zsocket is current.

            kandi-Quality Quality

              zsocket has 0 bugs and 0 code smells.

            kandi-Security Security

              zsocket has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              zsocket code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              zsocket 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

              zsocket releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of zsocket
            Get all kandi verified functions for this library.

            zsocket Key Features

            No Key Features are available at this moment for zsocket.

            zsocket Examples and Code Snippets

            No Code Snippets are available at this moment for zsocket.

            Community Discussions

            QUESTION

            Dispose vs Terminate vs Shutdown in ZContext
            Asked 2018-Feb-06 at 06:33

            I am confused to see following 3 similar methods available in Zeromq C# API.

            1. Dispose
            2. Terminate
            3. Shutdown

            The above 3 methods looks similar by name. However I am not sure about their proper meaning.

            Basically, in the provided examples such as Weather update server, the dispose functionality is done automatically by C# because of keyword using. However, in my code, I want to dispose the ZContext object manually. See below the code snippet:

            ...

            ANSWER

            Answered 2018-Feb-06 at 06:33
            Short version:

            Well, there are certain magics under the hood of the ZeroMQ zmqContext() instance, which may well turn things into havoc.

            .Terminate() method is a mandatory API-call
            .Shutdown() method wraps an optional-only API-call, with a must to call the mandatory API-call
            .Dispose() method does GC.SuppressFinalize(this); first and calls .Terminate()

            Best practices:

            Be nice to resources. Better manage them explicitly and with a due care.
            Be cautions on closing the things, that worked. Can hang the whole circus by not doing things right.

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

            QUESTION

            Exception thrown: 'System.OutOfMemoryException' in ZeroMQ.dll
            Asked 2017-Dec-30 at 12:10

            I am trying to transfer a huge array of bytes (size: 12 MegaBytes) using ZeroMQ in Windows 10 64 Bit OS. The rate of transfer is 15 Frame Per Second approximately.

            The code is throwing following error:

            ...

            ANSWER

            Answered 2017-Dec-30 at 12:10
            Ad 2 ) Why is the exception ... though 801MB memory is still available?

            Better do not rely on static figures. Each JUMBO-message ( as depicted above ) has to be stored in several places, some of which are outside of the ZeroMQ domain of control ( typically the O/S & driver buffers ). Sure, ZeroMQ has done a great job on zero-copy, where possible, but injecting data onto network is typically an O/S job, so any free-space is "evaporating" pretty fast on Mammoth-sized data-blocks ( did I say, that ZeroMQ delivers either the whole, whatever sized data en-block, or nothing at all? ).

            Next, there are Context-class instance settings ( High Water Marks and other ) that explicitly warn about not relying on having XYZ [B] free and available for message-data if having set that very value of XYZ [B] -- due to whatever internal buffer-management tricks, the API documentation and comments promote to expect anything under 2/3, if not 1/2 of that setting to remain actually available for any message-related data ( not mentioning, what would happen with buffer-space "consumption" if there would happen to be more than a single .connect()-ed counterparties

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

            QUESTION

            OutOfMemoryException: zmq_msg_init_size ( ProcessMemory kept increasing to 4 GB )
            Asked 2017-Nov-23 at 13:13

            I am using ZeroMQ in C# language. It is throwing following error:

            ...

            ANSWER

            Answered 2017-Nov-23 at 12:17

            ZFrame implements IDisposable. As a general rule, you should Dispose of IDisposable objects when you are 'finished' with them.

            It is particularly important with ZFrame since it contains a DispoIntPtr (pointer to unmanaged memory).

            Without the Dispose call, it will not be freed in a timely manner. See https://github.com/zeromq/clrzmq4/blob/master/ZFrame.cs :

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

            QUESTION

            ZSocket.GetOptionString did not work in clrzmq4
            Asked 2017-Nov-13 at 02:36

            System environment : Windows 7(64bit), VS 2013, Compile in release 64bit

            This is the code:

            ...

            ANSWER

            Answered 2017-Nov-13 at 02:36
            EINVAL ( Error: 22 ) was thrown correctly:

            EINVAL
            The requested option option_name is unknown, or the requested option_len or option_value is invalid, or the size of the buffer pointed to by option_value, as specified by option_len, is insufficient for storing the option value.

            Must fix both of the below listed API non-compliant issues:
            1. The ZeroMQ API defines the ZMQ_TCP_KEEPALIVE socket-configuration option to be of an int data type, not a string. Use the appropriate clrzmq4 binding interface function to request an int typed option_value and this first API incompliance will be solved.

            Option value type int
            Option value unit { -1 | 0 | 1 }
            Default value -1 ( leave to OS default )
            Applicable socket types all, when using TCP transports.

            1. The ZeroMQ API defines this option to be valid if and only if the socket-instance was equipped with a tcp:// transport-class ( which the clients instance, as posted above, was not ). May defer the request to take place after the socket-instance has been instructed to associate a first tcp:// transport-class engine ( be it via a respective use of a .connect() or a .bind() ).

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

            QUESTION

            Using ZMQ in C # and Mac Os X
            Asked 2017-Jul-27 at 08:42

            I wanted to implement ICP on Mac OSX, so I learned about ZeroMQ through googling. I installed ZeroMQ using the brew install zmq command However, there is very little information about ZeroMq on Mac OSX, so I am having difficulty with some problems.

            This is an example uploaded on the ZeroMQ homepage.

            ...

            ANSWER

            Answered 2017-Jul-15 at 14:51

            I'd post this as a comment, but don't have the rep:

            Have you tried using NetMQ (https://github.com/zeromq/netmq)? I haven't used it on OSX (only Windows), but it's a native C# implementation of ZMQ that I've found to be pretty well designed, and in my opinion might be easier to get working than what you're using, which I assume is a C# wrapper around the C library.

            Also, if you want help with the specific library that you're using, you should probably post what ways you've already tried to fix the exception, since you state there are "many ways to fix the exception, but there is no solution in Mac OSX".

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

            QUESTION

            Runtime "EndOfStreamException" error in MS Bond serialization over ZeroMQ
            Asked 2017-Jan-25 at 03:32

            To start off, it is worth mentioning that within a single F# solution, serializing and deserializing of Bond messages works fine. However, I am having trouble properly handling the sending and/or receiving of the message over ZeroMQ.

            There is a runtime error on the subscriber side of the following program. A .bond file is defined and compiled with the bond compiler. Then a dll is created from C# to be called from F# . I then have two F# programs. One that publishes serialized data over a tcp socket and another that is a subscriber. When the message is received on the sub, the line which tries to Unmarshal the raw data is the one that causes the runtime error. Can anyone see the reason for this?

            [EDIT] Per Fyodor's comment, I made a change on the publisher side which changes the error on the subscriber side. So the error likely has something to do with how i am packing and unpacking the information.

            This is the .bond file

            ...

            ANSWER

            Answered 2017-Jan-24 at 00:19

            On the receiving side, when you attempt to decode the marshaled Bond Compact Binary as an ASCII string, you're losing some of the payload. When marshaling a struct like Record to Compact Binary, the first four bytes of the payload are 0x43 0x42 0x10 0x00. When reading a string from a ZFrame, the first embedded NUL (0x00) that is encountered signals the end of the string, regardless of the size of the frame. So, the reading side sees only 0x43 0x42 0x10 instead of the whole payload (29 bytes when I tested).

            Since Compact Binary is a binary protocol, you'll want to use the ZFrame constructor that takes a buffer on the publisher side:

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install zsocket

            You can download it from GitHub.

            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/newtools/zsocket.git

          • CLI

            gh repo clone newtools/zsocket

          • sshUrl

            git@github.com:newtools/zsocket.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

            Explore Related Topics

            Consider Popular Networking Libraries

            Moya

            by Moya

            diaspora

            by diaspora

            kcptun

            by xtaci

            cilium

            by cilium

            kcp

            by skywind3000

            Try Top Libraries by newtools

            ebpf

            by newtoolsGo

            ipmap

            by newtoolsGo