Optimal size of send data
Options
Comments
-
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.0 -
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? Separately0 -
Nicole, how i can pause and resume sending?0
-
Just as you said: split your data in multiple parts and send them separately.0