Search Unity

NetMQ Basic

Discussion in 'Assets and Asset Store' started by bschumacher, Feb 14, 2015.

  1. bschumacher

    bschumacher

    Joined:
    Mar 9, 2014
    Posts:
    10
    I've added precompiled binaries for NetMQ and some examples in each language. The version that is currently up works fine on Windows, the MAC version has some bugs as soon as the update is published that should be fixed though with the latest build from the master branch.

    Available here: https://www.assetstore.unity3d.com/en/#!/content/29213

    If you want to compile the DLLs yourself you can get the source from: https://github.com/zeromq/netmq

    Open the NetMQ3.5.csproj and build.

    Terminating the context hangs Unity, let Unity clean up the context. Also, closing sockets causes high CPU usage if playing and stopping the editor. Disconnecting/Unbinding and letting Unity take care of the rest will save some CPU.

    Other than the cleanup issues everything else appears to be working fine for me. The update process for packages is kind of clunky so ignore the mistakes in the examples I will get them updated, I just noticed the CPU issue and figured out why it was happening.

    I'll be posting advanced examples soon, in all the languages and in some time a full game server built using NetMQ.
     
    twobob likes this.
  2. double dork

    double dork

    Joined:
    Feb 24, 2015
    Posts:
    2
    Hi Bschumacher, I have installed this on two computers now and even the basic scene (the C# one, but I also tried JS) simply hangs my unity version. I am activating the scene, then use the unity player. I do not get any messages, unity simply hangs. A standalone build does the same, it goes into "not responding" before even writing (flushing?) to the output_log.txt. If I comment out the sending and receiving parts (ie only opening and closing sockets), it runs fine and spits out all log messages.

    UPDATE: Using lots of log messages, I have found that the first receive ("m1=server.ReceiveString()") will never receive a message. I added a timeout, but this leads to a statemachine error in zmq because we then send a reply before a request (as the request never got there).

    Any insights?/
    Thanks,
    Dirk
     
    Last edited: Feb 25, 2015
  3. PeterJK

    PeterJK

    Joined:
    Dec 2, 2012
    Posts:
    35
    Same experience as double dork - perhaps there's a compatibility issue with Unity 5? I tried compiling the dll from latest code but same results.
     
  4. bschumacher

    bschumacher

    Joined:
    Mar 9, 2014
    Posts:
    10
    Ah didn't see your message there double dork.

    I thought I tried it on Unity 5. What operating systems are you running?

    I'll check again a bit later. Using the Web Player it will not work I know for sure, the standalone builds should work though.

    Try using the Boo example, just out of curiosity.
     
  5. PeterJK

    PeterJK

    Joined:
    Dec 2, 2012
    Posts:
    35
    Boo example hangs here also. Windows 8.1 here. Thanks for your help Bill :)
     
  6. bschumacher

    bschumacher

    Joined:
    Mar 9, 2014
    Posts:
    10
    It works in Unity 5 on OS X. Unity 5 on Windows support is definitely broken.

    I tried the latest sources as well. It worked fine on 4.6 using Windows.

    If there was some kind of output I would see if I could fix it, unfortunately it locks up completely.

    Sorry about that.
     
  7. PeterJK

    PeterJK

    Joined:
    Dec 2, 2012
    Posts:
    35
  8. bschumacher

    bschumacher

    Joined:
    Mar 9, 2014
    Posts:
    10
    I'll take a look when I get home and verify if that fixes it or not.

    I do have a much more advanced example with pub/sub and a protocol implementation that I was working on.
     
  9. PeterJK

    PeterJK

    Joined:
    Dec 2, 2012
    Posts:
    35
    It seems the issue was in using a domain name rather than an ip address in the client connect call. Using an IP address and I can get a basic pub/sub setup working :)
     
  10. lb00218

    lb00218

    Joined:
    Nov 18, 2014
    Posts:
    1
    Sorry to drag up this old thread. I've been trying to use netMQ recently, and I can't seem to get the dll into unity without getting this error:
    Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
    This is using a dll I compiled from the NetMQ3.5.csproj you gave a link to. Did anybody have this issue?
     
  11. bschumacher

    bschumacher

    Joined:
    Mar 9, 2014
    Posts:
    10
    Which version of Unity are you using and OS?
     
  12. assimoes

    assimoes

    Joined:
    May 31, 2016
    Posts:
    7
    Sorry for bringing a dead topic from the dead.

    That message is misleading. Did you copy the Async.IO dll into your Assets folder? That solved the issue for me.