sendSync method
void
sendSync({})
Implementation
void sendSync({
required List<int> value,
Duration durationTimeOut = const Duration(minutes: 1),
Duration durationDelay = const Duration(milliseconds: 1),
}) {
DateTime dateTime = DateTime.now().add(durationTimeOut);
sleep(durationDelay);
while (true) {
sleep(durationDelay);
if (dateTime.isBefore(DateTime.now())) {
throw SocketError({
"@type": "socketError",
"message": "send_data_time_out",
"description": "Send Data time out "
});
}
if (isConnect) {
break;
}
}
return socket.add(value);
}