addMessage method

void addMessage(
  1. ClientMessage message
)

Adds a Client Message to the existing connection

This is a low level API and the message must follow the protocol of this connection. It's the responsiblity of the caller to ensure this message does not interfere with any running queries or transactions.

Implementation

void addMessage(ClientMessage message) {
  if (isClosed) {
    throw PostgreSQLException(
        'Attempting to add a message, but connection is not open.');
  }
  _socket!.add(message.asBytes(encoding: encoding));
}