API
TransportClientConnectionPoolโ
class TransportClientConnectionPool {
List<TransportClientConnection> get clients
TransportClientConnection select()
void forEach(FutureOr<void> Function(TransportClientConnection provider) action)
int count()
Future<void> close({Duration? gracefulTimeout})
}
Propertiesโ
clientsโ
Connected clients inside the pool.
Methodsโ
selectโ
Round-robin client selection.
forEachโ
Invokes an action for each client.
countโ
Number of current clients.
closeโ
Closes all client connections.
TransportClientsFactoryโ
class TransportClientsFactory {
Future<TransportClientConnectionPool> tcp(
InternetAddress address,
int port, {
TransportTcpClientConfiguration? configuration,
}) async
TransportDatagramClient udp(
InternetAddress sourceAddress,
int sourcePort,
InternetAddress destinationAddress,
int destinationPort, {
TransportUdpClientConfiguration? configuration,
})
Future<TransportClientConnectionPool> unixStream(
String path, {
TransportUnixStreamClientConfiguration? configuration,
}) async
}
Methodsโ
tcpโ
Creates TCP clients (pooled).
udpโ
Creates UDP single client.
unixStreamโ
Creates UNIX Socket clients.
TransportDatagramClientโ
class TransportDatagramClient {
bool get active
Stream<TransportPayload> get inbound
Future<void> receive({int? flags})
Stream<TransportPayload> stream({int? flags})
void sendSingle(
Uint8List bytes, {
int? flags,
void Function(Exception error)? onError,
void Function()? onDone,
})
void sendMany(
List<Uint8List> bytes, {
int? flags,
bool linked = false,
void Function(Exception error)? onError,
void Function()? onDone,
})
Future<void> close({Duration? gracefulTimeout})
}
Propertiesโ
activeโ
Client live status.
inboundโ
Stream for inbound (read) payloads.
Methodsโ
receiveโ
Initiates a receive event for new data from the client.
streamโ
Automatically reads a stream of inbound data from the client.
sendSingleโ
Sends a single message to the client.
sendManyโ
Sends multiple messages to the client.
closeโ
Closes the client.
TransportClientConnectionโ
class TransportClientConnection {
bool get active
Stream<TransportPayload> get inbound
Future<void> read()
Stream<TransportPayload> stream()
void writeSingle(Uint8List bytes, {void Function(Exception error)? onError, void Function()? onDone})
void writeMany(List<Uint8List> bytes, {linked = true, void Function(Exception error)? onError, void Function()? onDone})
Future<void> close({Duration? gracefulTimeout})
}
Propertiesโ
activeโ
Client connection live status.
inboundโ
Stream for inbound (read) payloads.
Methodsโ
readโ
Initiates a read event for new data from the connection.
streamโ
Automatically reads a stream of inbound data from the connection.
writeSingleโ
Writes a single buffer to the connection.
writeManyโ
Writes many buffers to the connection.
closeโ
Closes the connection.