mirror of
https://github.com/Linloir/Simple-TCP-Client.git
synced 2025-12-18 09:18:11 +08:00
Improvements
- add await during file recept
This commit is contained in:
parent
01568cfe9b
commit
2a6dc0d97f
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* @Author : Linloir
|
* @Author : Linloir
|
||||||
* @Date : 2022-10-13 14:03:56
|
* @Date : 2022-10-13 14:03:56
|
||||||
* @LastEditTime : 2022-10-18 17:09:55
|
* @LastEditTime : 2022-10-19 00:37:31
|
||||||
* @Description :
|
* @Description :
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* @Author : Linloir
|
* @Author : Linloir
|
||||||
* @Date : 2022-10-11 09:42:05
|
* @Date : 2022-10-11 09:42:05
|
||||||
* @LastEditTime : 2022-10-18 14:50:33
|
* @LastEditTime : 2022-10-19 00:57:05
|
||||||
* @Description : TCP repository
|
* @Description : TCP repository
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -29,6 +29,7 @@ class TCPRepository {
|
|||||||
try{
|
try{
|
||||||
await for(var response in _socket) {
|
await for(var response in _socket) {
|
||||||
_pullResponse(response);
|
_pullResponse(response);
|
||||||
|
await Future.delayed(const Duration(microseconds: 0));
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
_socket.close();
|
_socket.close();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user