sendMessage abstract method
Writes socket control messages and data bytes to the socket.
WritescontrolMessages and up tocount bytes ofdata,starting atoffset, to the socket. Ifcount is not provided,as many bytes as possible are written. Usewrite instead if no controlmessages are required to be sent.
When sent control messages are received, they are retained until thenext call toreadMessage, where all currently available control messagesare provided as part of the returnedSocketMessage.Callingread will read only data bytes, and will not affect controlmessages.
Thecount must be positive (greater than zero).
Returns the number of bytes written, which cannot be greater thancount, nor greater thandata.length - offset.Return value of zero indicates that control messages were not sent.
This function is non-blocking and will only write dataif buffer space is available in the socket.
Throws anOSError if message could not be sent out.
Unsupported byRawSecureSocket.
Unsupported on Android, Fuchsia, Windows.
Implementation
int sendMessage( List<SocketControlMessage> controlMessages, List<int> data, [ int offset = 0, int? count,]);