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.
- 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.
- Compile NetMQ3.5 using AsyncIO.Unity instead of the default binary. Copy all the files from \src\Net35\bin<Release> to \Assets\plugins
- Add \Source\AsyncIO\AsyncIO.Unity.csproj to the Unity project's C# solution.
- From the AsyncIO.Unity project, open DotNet\NativeSocket.cs and place a breakpoint on line 58. This should be the line "operationType = OperationType.Send;"
- Create a new C# project on another computer using Server.cs and run the program.
- Attach the debugger to Unity and hit play.
The result of this should be the debugger stopping 4 times on the NativeSocket.cs breakpoint. The first 3 times are during the socket.connect()stage, the last is when the message is actually sent.
If the breakpoint is removed, the message does not seem to be sent to the destination socket. PS: When adding hit conditions to the breakpoint, occasionally the breakpoint will still fail to fire. The line hit count will usually range from 1-2 hits rather than the expected 4.