DBusAddress.tcp constructor
DBusAddress.tcp(
- String host, {
- String? bind,
- int? port,
- DBusAddressTcpFamily? family,
Creates a new D-Bus address connecting to a TCP socket.
Implementation
factory DBusAddress.tcp(String host,
{String? bind, int? port, DBusAddressTcpFamily? family}) {
var properties = <String, String>{'host': host};
if (bind != null) {
properties['bind'] = bind;
}
if (port != null) {
properties['port'] = '$port';
}
if (family != null) {
properties['family'] = {
DBusAddressTcpFamily.ipv4: 'ipv4',
DBusAddressTcpFamily.ipv6: 'ipv6'
}[family]!;
}
return DBusAddress.withTransport('tcp', properties);
}