Distributed Music Player
Each message passed over the TCP control connection has the following format
A network packet | ||||
---|---|---|---|---|
1 byte | 4 bytes | 1 byte | 4 bytes | size bytes |
encryption sentinel | possibly encrypted message::Type | encryption sentinel | size of message uint32_t | possibly encrypted message |
For the time being all these components are sent separately resulting in 5 network packets. This is somewhat inefficient, it could be reduced quite easily to 1 packet when sending unencrypted and 2 packets when sending encrypted, due to way messages are currently handled. But it's not a priority until this becomes a performance bottle neck.
The Serialization archive format is straight forward. For each member of a struct serialize it members from top to bottom.
If the variable is
separate each type you have serialized with a space.
DMP uses libsodium for encryption and password hashing for more information regarding the encryption used in the protocol specified above, please refer to libsodium
First we install the dependencies (for the client)
brew install icu4c taglib boost qt5 gstreamer libsodium gst-plugins-good
brew install gst-plugins-ugly --build-from-source
Then we can run cmake as usual. BUT: linking qt5 does not work out of the box (there
is no macosx-clang
binary in /usr/local/?
). But one can set the following
cmake options:
Qt5Core_DIR /usr/local/Cellar/qt5/5.4.1/lib/cmake/Qt5Core
Qt5Gui_DIR /usr/local/Cellar/qt5/5.4.1/lib/cmake/Qt5Gui
Qt5Widgets_DIR /usr/local/Cellar/qt5/5.4.1/lib/cmake/Qt5Widgets