I am programming an application for the hololens (Platform=>UWP) with Unity3D.
----------
Currenty, my NodeJs Server writes one value (that is updating all the time) in a file IP-ADRESS/value.txt
----------
And on my C# Script, I do the following to read that value from the file:
----------
IEnumerator UpdateView() {
UnityWebRequest www = UnityWebRequest.Get("http://192.168.15.5:7777/value.txt");
yield return www.SendWebRequest();
if (www.responseCode == 200) {
// www.downloadHandler.text <- my value
// my code ...
}
}
void Update() {
StartCoroutine(UpdateView());
}
----------
I know, it isn't very effective, because writing and reading a file costs much time, so I want to implement a c# client that can get the values directly from the nodejs script.
----------
I've found this one on the internet, but couldn't make it work.
https://www.infoworld.com/article/2917047/microsoft-net/developing-applications-with-nodejs-and-c.html
It says TcpClient not found and the using namespace is missing.
Can you give me some advices, how I can solve such a problem?
Thank you very very much
↧