UdpClient could not be found in Unity building for Hololens

Hello

I’m trying to use UDP connection with Hololens

I’m using : Visual Studio 2015 and Unity 5.6.1f1 (64 bit)

So my build setting in Unity is :

Windows Store
SDK Universal 10
UWP SDK 10.0.15063

So when I try to build, I have an error :

error CS0246 : The type or namespace name ‘UdpClient’ could not be found (are you missing a using directive or an assembly reference ?)
I have the System.Net reference in Visual Studio

The begining of my C# code is :

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

public class Transfert : MonoBehaviour
{
private UdpClient udpclient;

private Thread myThreadReceive;

private GUIText essai;

public void Init()
{
udpclient = new UdpClient(9897);

1 Like

Unity is compatible with UDPClient(namespace => System.Net.Sockets) for UWP platforms. It will perfectly work with PC build through Unity. Probably you have to create a plugin for the same to work