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. Dismiss Notice

Run WCF ServiceHost in Unity

Discussion in 'Scripting' started by Ludeme Games, Jan 23, 2015.

  1. Ludeme Games

    Ludeme Games

    Joined:
    Aug 3, 2012
    Posts:
    9
    I'm trying to run a ServiceHost in to host a server for an internal tool running in the Unity editor (with the game running). When the program runs in a console, it works just fine. However, when running in Unity clients can connect to the channel but the first time they try to use the service they are met with a timeout.

    My first guess is that the Unity UI thread is somehow clobbering whatever WCF needs to process messages, but I can't find much information about this, it's just a guess. (WCF could just as easily be silently failing somewhere)

    1. Is there a way to get a ServiceHost in Unity up and running?
    2. What alternatives would you consider easiest to get a simple but robust RPC with events server running in Unity to replace WCF is no solution can be found?


    -- Side note: I tried to post this in UnityAnswers, but I'm met with an error "The following topics are not present in the system, and you don't have permissions to create new ones: WCF, Server, Thread, ServiceHost"
     
  2. Korigoth

    Korigoth

    Joined:
    Jul 21, 2014
    Posts:
    105
    i would also like to know how to create a client with the WCF service.
     
  3. Ludeme Games

    Ludeme Games

    Joined:
    Aug 3, 2012
    Posts:
    9
    I ended up having to write my own replacement for it... which ended up needing MSIL emitting. Quite a pain.
     
  4. mipecr

    mipecr

    Joined:
    Dec 10, 2015
    Posts:
    5
    Ludeme, Could you write some lines of your ServiceHost?
    Thanks.
     
  5. bk0606

    bk0606

    Joined:
    Aug 21, 2014
    Posts:
    4
    Face the same problem.
    I shall be grateful for any help..