Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where do you learn about unity ZeroMQ? #8

Open
offchan42 opened this issue Sep 16, 2018 · 2 comments
Open

Where do you learn about unity ZeroMQ? #8

offchan42 opened this issue Sep 16, 2018 · 2 comments

Comments

@offchan42
Copy link

offchan42 commented Sep 16, 2018

There is learning for ZeroMQ Python and C# but they are not specific to unity and I saw you use AsyncIO as well which is confusing for me because I'm not good at network programming.
If I want to build a request-reply model but I want python to be the server instead of C#, how do I accomplish this task?

Python = server
C# = client

The idea is, I want to make some computation in python and return value to caller from C#. E.g. run machine learning model on an image sent by unity webcam and return the prediction to unity.
The time it takes to run the computation might be long so unity should not wait for python to finish. Python have to callback unity later.
Please give materials for me to learn about ZeroMQ request-reply model in unity. Any suggestions are appreciated!

@offchan42 offchan42 changed the title Where do you learn these things? Where do you learn about unity ZeroMQ? Sep 16, 2018
@valkjsaaa
Copy link
Owner

I suggest you learn the concept of ZeroMQ from here: Learn ZeroMQ

Then, you find the corresponding functionality in NetMQ, and implemented. Note that Unity engine works very badly with NetMQ, so you may need to watch out a few tricks that I'm doing here, such as open a new thread, AsyncIO.ForceDotNet.Force();, and NetMQConfig.Cleanup();. Even then, there is not guarantee that it will work.

@offchan42
Copy link
Author

Can you clarify what those 2 commands exactly do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants