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.

cannot receive HTTP messages on HoloLens server

i've been trying for days to implement a simple server on HoloLens to receive HTTP packets sent from a smart object on a local network.

My code so far is the following (i report only the part of the code that actually runs on HoloLens):`

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
using UnityEngine.Networking;
using System.Net.Sockets;
using System.Net;
using System.Threading;
using System.Text;
using UnityEngine.UI;

    using Windows.Networking;
    using Windows.Networking.Sockets;
    using Windows.Storage.Streams;
    using Windows.Networking.Connectivity;

public class DolphinManager : MonoBehaviour
    private static string holoLensIpAddr = "";  
    private static int holoLensPort = 12345;

    private HttpListener _listener;

    private StreamReader reader;
    private StreamSocketListener listener;

    void Start()

        Invoke("InitializeUnityServer", 4f);

        Invoke("InitializeUWPServer", 4f);

    private async void InitializeUWPServer()
                listener = new StreamSocketListener();
                serverHost = new Windows.Networking.HostName(anyIp);
                listener.ConnectionReceived += Listener_ConnectionReceived;
                listener.Control.KeepAlive = false;
                await listener.BindServiceNameAsync(holoLensPort.ToString());

            } catch(Exception e) { Debug.Log(e.Message); }


    private async void Listener_ConnectionReceived(StreamSocketListener sender, StreamSocketListenerConnectionReceivedEventArgs args)
            Debug.log("message received!");

The server starts correctly, but when i try to send a packet from my smart object, Listener_ConnectionReceived() is not triggered.

I have already set the PrivateNetworkClientServer capability on the app manifest.

What could be wrong? Thank you in advance!

Sign In or Register to comment.