Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

TCP Client on Hololens Emulator ?

Hy guys,

I'm trying for 3 hours to get a TCP Client running on the hololens emulator (PC) and sends a string over wifi to a MATLAB TCP Server running on my Surface. Both are in the same wlan but I'm not able to send the string.
I tested my settings with my UDP Client on the hololens emulator and the udp server in MATLAB but this works.
I used the recommended files from Microsoft:
https://docs.microsoft.com/en-us/windows/uwp/networking/sockets

Please help me :(

Best Answer

Answers

  • Options

    The funny thing about the error is that I have access to the internet but cannot send a string to my Surface over TCP ??? I checked my firewall settings and I also created a rule for this port (incoming and outcoming). :s:s:s:s

  • Options

    this is my code :

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using System;
    using System.IO;

    if !UNITY_EDITOR

    using Windows.Networking.Sockets;
    using Windows.Networking;
    using Windows.Networking.Connectivity;

    endif

    public class NewBehaviourScript2 : MonoBehaviour {

    if !UNITY_EDITOR

    private async void Start()
    {
    
        Windows.Networking.Sockets.StreamSocket socket = new Windows.Networking.Sockets.StreamSocket();
        Windows.Networking.HostName server = new Windows.Networking.HostName("192.168.0.xx");
        string serverPort = "8000";
        await socket.ConnectAsync(server, serverPort);
    
        Stream streamOut = socket.OutputStream.AsStreamForWrite();
        StreamWriter writer = new StreamWriter(streamOut);
        string message = "Hallo Server";
        await writer.WriteLineAsync(message);
        await writer.FlushAsync();
    
    
    
    }
    

    else

    // Use this for initialization
    void Start()
    {
    
    }
    

    endif

    }

Sign In or Register to comment.