void OnTriggerEnter(Collider colSend)
    {
        currentCount++;

        dataToSend newMessage = new dataToSend();

        newMessage.totalHits = currentCount;
        newMessage.status    = 1;

        Debug.Log("YOU HIT ME!!");
        dataServer.Publish()
        .Channel(publishChannel)
        .Message(newMessage)
        .Async((result, status) =>
        {
            if (!status.Error)
            {
                Debug.Log(string.Format("Publish Timetoken: {0}", result.Timetoken));
            }
            else
            {
                Debug.Log(status.Error);
                Debug.Log(status.ErrorData.Info);
            }
        });
    }
Beispiel #2
0
        void Odosli(IPAddress ipadresa, byte[] data, int Acknum)
        {
            dataToSend dToSend = new dataToSend();

            dToSend.AckNum = Acknum;
            dToSend.Address = ipadresa;
            dToSend.data = data;

            ToSend.Add(dToSend);

            Thread Odosielanie = new Thread(new ThreadStart(Odoslat));
            Odosielanie.IsBackground = true;
            Odosielanie.Start();
        }