sendSync method
void
sendSync(
{ - required List<int> value,
- Duration durationTimeOut = const Duration(minutes: 1),
})
Implementation
void sendSync({
required List<int> value,
Duration durationTimeOut = const Duration(minutes: 1),
}) {
DateTime dateTime = DateTime.now().add(durationTimeOut);
while (true) {
sleep(Duration(microseconds: 10));
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);
}