send method
Send a given payload to the server. The payload is json-encoded before sending.
Implementation
bool send({
required Map<String, dynamic> payload,
required String topic,
bool silent = false,
}) {
final data = {
'topic': topic,
'type': 'pub',
'payload': json.encode(payload),
'silent': silent,
};
final message = json.encode(data);
return _socket?.send(message) ?? false;
}