Пример #1
0
    private void _request(string trackerPort, string receivePort)
    {
        UdpClient  udp            = new UdpClient();
        IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Broadcast, int.Parse(trackerPort));
        string     message        = SurfaceMessage.createRequestMessage(int.Parse(receivePort));

        byte[] data = Encoding.UTF8.GetBytes(message);
        udp.Send(data, data.Length, remoteEndPoint);
    }
Пример #2
0
    void Awake()
    {
        Debug.Log("Hello Tracker");
        _clouds           = new Dictionary <string, PointCloudSimple> ();
        _cloudGameObjects = new Dictionary <string, GameObject>();
        _loadConfig();



        UdpClient udp     = new UdpClient();
        string    message = AvatarMessage.createRequestMessage(1, TrackerProperties.Instance.listenPort);

        byte[]     data           = Encoding.UTF8.GetBytes(message);
        IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Broadcast, TrackerProperties.Instance.trackerPort);

        Debug.Log("Sent request to port" + TrackerProperties.Instance.trackerPort + " with content " + message);
        udp.Send(data, data.Length, remoteEndPoint);

        message = SurfaceMessage.createRequestMessage(TrackerProperties.Instance.listenPort);
        data    = Encoding.UTF8.GetBytes(message);
        Debug.Log("Sent request to port" + TrackerProperties.Instance.trackerPort + " with content " + message);
        udp.Send(data, data.Length, remoteEndPoint);
    }