Hello. I have a pretty cool Arduino project working where I can use a rotary telephone to communicate with an html page by using a node.js server to “listen” for data sent by the Arduino or speak to the Arduino by emitting data from the html page.
Neat right? But now I want to apply this technology to a monogame project instead of an html page.
So I only need to figure out the syntax how to emit data from a monogame project the same way I am emitting it from an html page.
The javascript on the html page code is pretty simple.
First I just need to include this socket library:
<script src='https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.4/socket.io.js'></script>
Then I need to connect to localhost:
var socket = io('http://localhost:3000');
Finally I can emit data like this:
socket.emit('lights', { "status": "1" });
So that was in javascript. Now I just need to determine the equivalent syntax in C# with the Monogame library. I have no idea how to find this syntax.