Servidor de socket simple en Unity

Quiero usar un complemento C # en mi proyecto de Unity. Ese complemento debe actuar como un servidor que obtendrá valores de un cliente para que pueda usar esos valores para su posterior procesamiento. El problema es que el servidor tiene bucle infinito. Y los bucles infinitos hacen que la Unidad se cuelgue. ¿Cómo manejar esto?

EDITAR: adjunto un fragmento de código del programa del servidor. En mi opinión, hay 2 puntos que pueden estar causando problemas. Los bucles infinitos y el punto donde el programa se suspende como se comenta en el código:

void networkCode()
{
    // Data buffer for incoming data.
    byte[] bytes = new Byte[1024];

    // Establish the local endpoint for the socket.
    // Dns.GetHostName returns the name of the 
    // host running the application.
    IPHostEntry ipHostInfo = Dns.Resolve(Dns.GetHostName());
    IPAddress ipAddress = ipHostInfo.AddressList[0];
    IPEndPoint localEndPoint = new IPEndPoint(ipAddress, 1755);

    // Create a TCP/IP socket.
    listener = new Socket(ipAddress.AddressFamily,
        SocketType.Stream, ProtocolType.Tcp);

    // Bind the socket to the local endpoint and 
    // listen for incoming connections.
    try
    {
        listener.Bind(localEndPoint);
        listener.Listen(10);

        // Start listening for connections.
        while (true)
        {
            // Program is suspended while waiting for an incoming connection.
            Debug.Log("HELLO");     //It works
            handler = listener.Accept();
            Debug.Log("HELLO");     //It doesn't work
            data = null;

            // An incoming connection needs to be processed.
            while (true)
            {
                bytes = new byte[1024];
                int bytesRec = handler.Receive(bytes);
                data += Encoding.ASCII.GetString(bytes, 0, bytesRec);
                if (data.IndexOf("<EOF>") > -1)
                {
                    break;
                }

                System.Threading.Thread.Sleep(1);
            }   

            System.Threading.Thread.Sleep(1);
        }
    }
    catch (Exception e)
    {
        Debug.Log(e.ToString());
    }
}

EDITAR: después de la ayuda de @Programmer, el complemento C # está completo. Pero Unity no está leyendo los valores correctos. Adjunto el código lateral de Unity:

using UnityEngine;
using System;

using SyncServerDLL;    //That's our library

public class receiver : MonoBehaviour {

    SynchronousSocketListener obj;   //That's object to call server methods

    // Use this for initialization
    void Start() {
        obj = new SynchronousSocketListener ();
        obj.startServer ();
    }

    // Update is called once per frame
    void Update() {
        Debug.Log (obj.data);
    }
}

He probado la clase SynchronousSocketListener a fondo en Visual Studio. Está dando buenos resultados allí.

Respuestas a la pregunta(1)

Su respuesta a la pregunta