onConnect method
- SocketInfo source
Sets destination to the incoming source
.
Override this function to run custom code when a device connects to this socket.
Implementation
@mustCallSuper
void onConnect(SocketInfo source) {
destination = source;
_connectionCompleter?.complete();
_connectionCompleter = null; // to avoid completing twice
logger.info("Port $port is connected to $source");
}