serialize abstract method
Serialize a given message, should return a String or a UInt8List. The return type is dynamic, because the socket class takes a dynamic type to send either a string or a binary message.
Implementation
dynamic serialize(AbstractMessage message);