SMU-SIS / ecology

Lightweight library to easily build cross-device applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Delay in receiving data by Ecology from SocketCreator when continuous data is sent via WiFiP2P.

anurooppv opened this issue · comments

The handler which is used to send the received bytes in SocketCreator to Ecology is too slow and hence there is mismatch of data. SocketCreator receives all the data correctly but there is loss of data in Ecology because of the slow transmission of data by the handler.

Below case is an example:

If I send 100 events continuously via WiFi P2P from one device to another, I do receive 100 data correctly in the other device when I read from the input stream. But when I log these bytes in the Ecology, I can see the first data correctly, then 11th data repeats 10 times and so on.

This has been fixed by adding length of the data in the message and creating buffer size accordingly and reading the whole data.