RSocketRequester constructor
RSocketRequester(
- String mode,
- ConnectionSetupPayload connectionSetupPayload,
- DuplexConnection connection
Implementation
RSocketRequester(String mode, ConnectionSetupPayload connectionSetupPayload,
DuplexConnection connection) {
this.mode = mode;
if (mode == 'requester') {
streamIdSupplier = StreamIdSupplier.clientSupplier();
} else {
streamIdSupplier = StreamIdSupplier.serverSupplier();
}
this.connectionSetupPayload = connectionSetupPayload;
this.connection = connection;
if (this.connection.receiveHandler == null) {
this.connection.receiveHandler = (chunk) => receiveChunk(chunk);
}
this.connection.closeHandler = () {
close();
};
initRSocketCallStubs();
}