sendAndClose method
will send a single message to the socket and then immediately close it. Use this when you don't care about the response.
Implementation
Future sendAndClose(Object msg, {appendTerminator = true}) {
send(msg, appendTerminator: appendTerminator);
return close();
}