Skip to content

Instantly share code, notes, and snippets.

@Mystfit
Mystfit / test_radio_dish_udp.h
Last active July 15, 2024 10:55
libzmq Radio/Dish example using UDP multicast
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <unistd.h> // for usleep
#define ZMQ_BUILD_DRAFT_API
#include <zmq.h>
@Mystfit
Mystfit / README.md
Created October 17, 2015 14:58
Lightweight Server/Client for testing Netmq Unity issues

A small client/server application using C# and Unity to track down issues with AsyncIO not triggering OnCompleted. This test was performed on Windows 10 using Unity 5.2.1f and Visual Studio Community 2015.

  1. Create a new Unity project. Add ReqRepUnity.cs as a component to a new GameObject. Enter the ip and port of the server in the "address" and "port" fields of the component.
  2. Compile NetMQ3.5 using AsyncIO.Unity instead of the default binary. Copy all the files from \src\Net35\bin<Release> to \Assets\plugins
  3. Add \Source\AsyncIO\AsyncIO.Unity.csproj to the Unity project's C# solution.
  4. From the AsyncIO.Unity project, open DotNet\NativeSocket.cs and place a breakpoint on line 58. This should be the line "operationType = OperationType.Send;"
  5. Create a new C# project on another computer using Server.cs and run the program.
  6. Attach the debugger to Unity and hit play.