1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vweb,net: just log errors in accept() instead of panic-ing, add time.sleep(1ms) after each retry in select (#10489)

This commit is contained in:
Tomas Hellström
2021-06-17 09:41:26 +02:00
committed by GitHub
parent c2a7a84c72
commit 46eb6befd5
2 changed files with 10 additions and 3 deletions

View File

@@ -333,7 +333,11 @@ pub fn run<T>(global_app &T, port int) {
// request_app.Context = Context{
// conn: 0
//}
mut conn := l.accept() or { panic('accept() failed') }
mut conn := l.accept() or {
// failures should not panic
eprintln('accept() failed with error: $err.msg')
continue
}
go handle_conn<T>(mut conn, mut request_app)
}
}