Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Windows Universal 10 missing definitions for Socket and Thread...

Discussion in 'Windows' started by KalebBK, Sep 29, 2015.

  1. KalebBK

    KalebBK

    Joined:
    Jun 15, 2015
    Posts:
    7
    Trying to get my app to run on a Raspberry Pi 2 with Windows IoT using Universal 10 build. Followed the steps that others seem to be using with success, including checking the Unity C# Projects box.

    Using 5.2.1p1 to get around some of the other name spacing bugs.

    When I try to build, I get compiler errors for the Socket and Thread objects.

    Just a couple of examples, but every function I call on the objects results in an error:

    Assets\Scripts\UdpBroadcastClient.cs(48,10): error CS1061: 'Socket' does not contain a definition for 'Close' and no extension method 'Close' accepting a first argument of type 'Socket' could be found (are you missing a using directive or an assembly reference?)

    Assets\Scripts\UdpBroadcastClient.cs(111,11): error CS0117: 'Thread' does not contain a definition for 'Sleep'

    Anyone have some ideas?
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,507
    It seems that these methods in fact don't exist in the Windows Store subset of the .NET Framework.

    You can replace .Close() with .Dispose().

    Thread.Sleep can be replaced with a PInvoke to Sleep() inside Kernelbase.dll.
     
    Pendrokar likes this.
  3. Rosehardt

    Rosehardt

    Joined:
    May 12, 2013
    Posts:
    2
    Is there maybe a list or something which functions are not available and what to replace them with? I am having a very similar problem with Thread and Start, Abort. Also with Stream Close.
     
    roumenf likes this.