User Tools

Site Tools


changes_features_fixes

This is an old revision of the document!


Upcoming Changes, Features and Fixes

Changes

Install php to use this new change.

Rewrote socket library so we don't need to use the normal and big buffer sizes. pilight can know handle socket messages of any size. Please notice that this commit will break all externally developed apps. Please check the various language examples to. see how the new implementation works.

Until pilight 2.1 two fixed socket buffers were used. One with the size of 1024 bytes and one with the size of 102400 bytes. This distinction has been dropped.

pilight will now send all streams in 1024 chunks. If these streams are shorter than 1024, everything was sent at once. If a stream is 1024 bytes, then you'll know it's a chunk of a bigger stream. In that case, read until you encounter the end of streams delimiter which is currently made up of two new lines \n\n.

If multiple streams were buffered somewhere, you can also distinct them by the double new line delimiters. An example:

{"message": "test"}\n\n
{"message": "test"}\n\n
{"message": "test"}\n\n

As you can see. pilight wanted to send three messages, but the TCP sockets concencated them to one.

The pilight socket_read function takes care of these buffered messages to check if we encountered concencated multiple streams. pilight will then convert these messages back so the output is just big stream separated by single newlines:

{"message": "test"}\n
{"message": "test"}\n
{"message": "test"}\n

You can check the various code example for more clarity.

Fixes & improvements

changes_features_fixes.1393011583.txt.gz · Last modified: 2015/11/27 21:08 (external edit)