Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

UNET message acknowledgement.

Discussion in 'Connected Games' started by MaxZemsky, Aug 12, 2018.

  1. MaxZemsky

    MaxZemsky

    Joined:
    Nov 7, 2017
    Posts:
    14
    I am using the NetworkServer.SendToAll method - I need to know when a message has successfully reached all the clients (the second message should be sent only when the first message has been received by all the Clients). How can I do this?
    Thanks!
     
  2. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    Shortly, no way. We did think about notifications, but now i afraid that is not possible. Sorry about :( you are still able to implement this on top of transport by receiving ack from all peers. For ack i think allcost qos should be used
     
  3. MaxZemsky

    MaxZemsky

    Joined:
    Nov 7, 2017
    Posts:
    14
    I send a big about of positions updates over the UNET. In certain point the network bandwidth reaches it's maximum (1.5MB/sec). Is there a way i could monitor it to prevent this?
    Originally, i thought to send the next message only when the previous message has been received by all the clients. Is there any workaround that i can implement?
     
  4. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    two things if you want just monitor your bandwidth, you can use bandwidth related statistical functions provided by library. If you want to avoid false receiving on your Send() call, you can provide set sendable callback, which will hit every time when library will have space for new message. Examples - see server.dll documentation and library reference.
     
  5. MaxZemsky

    MaxZemsky

    Joined:
    Nov 7, 2017
    Posts:
    14
    Thank you for your fast reply.
    In the server documentation i have found the following callback:
    Code (CSharp):
    1. GlobalConfig config = new GlobalConfig();
    2. config.SendCallback = new SendCallbackDelegate(SendCallback);
    Is this the "sendable callback" you were talking about?

    However, i cannot find this callback function in the UnityEngine.Networking.GlobalConfig class.

    Am i missing something?
     
  6. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574