TcpClient.withStringTerminator constructor

TcpClient.withStringTerminator(
  1. String host,
  2. int port,
  3. String terminatorString, {
  4. Duration timeout = const Duration(seconds: 2),
})

Same as the default constructor, but builds the terminatorBytes from the UTF8 encoding of the given string.

Implementation

TcpClient.withStringTerminator(
  this.host,
  this.port,
  String terminatorString, {
  this.timeout = const Duration(seconds: 2),
}) {
  terminatorBytes = Uint8List.fromList(terminatorString.codeUnits);
}