...
See how protocol is handled by Server:
https://github.com/OpenDevice/OpenDevice/blob/master/opendevice-core/src/main/java/br/com/criativasoft/opendevice/core/command/CommandStreamSerializer.javahttps://github.com/OpenDevice/OpenDevice/blob/master
/opendevice-core/src/main/java/br/com/criativasoft/opendevice/core/DefaultCommandProcessor.java