Optimal size of send data

Options
robertono
robertono
edited May 2014 in Photon Server
Need to send from server to one client big size of data (may be 10 mbytes).
How i can do this optimal, without any lags on the server side?

Comments

  • [Deleted User]
    Options
    Hey,

    Photon Server is in general optimized for many small messages, not so much for transfer of large messages... one thing you should definitely do:

    Photon has a built-in "flow control" - this means that the server gives a signal when lots of data is queued on the server side because the client can not receive / process it in time - in that case, PeerBase.OnSendBufferFull() is called. Per default, the connection gets disconnected in that case.
    You should override the OnSendBufferFull() method and pause sending, and then resume sending when Photon lets you know that the queue is empty again by calling PeerBase.OnSendBufferEmpty - you should override that method as well.
  • robertono
    Options
    Nicole wrote:
    Hey,

    Photon Server is in general optimized for many small messages, not so much for transfer of large messages... one thing you should definitely do:

    Photon has a built-in "flow control" - this means that the server gives a signal when lots of data is queued on the server side because the client can not receive / process it in time - in that case, PeerBase.OnSendBufferFull() is called. Per default, the connection gets disconnected in that case.
    You should override the OnSendBufferFull() method and pause sending, and then resume sending when Photon lets you know that the queue is empty again by calling PeerBase.OnSendBufferEmpty - you should override that method as well.

    Good idea, i'll try later.
    What do you think about this idea : i can split data for ex 10kb and send every 10kb of data? Separately
  • robertono
    Options
    Nicole, how i can pause and resume sending?
  • [Deleted User]
    Options
    Just as you said: split your data in multiple parts and send them separately.