How to ping faster when I reach unreachable IP?

前端 未结 5 1390
抹茶落季
抹茶落季 2020-12-16 22:15

I have an app which pings IP or IP range. The problem is that when hosts are closed it takes longer to ping than they are open. When host is closed the time to ping is about

5条回答
  •  离开以前
    2020-12-16 23:07

    You need to redesign your application to use multithreading -> tasks. Issue a task for each ping, and when you receive a response from a given host fire an event and update the UI. Changing socket timeout will only help you to reduce the timeout from outrageous to insufferable.

提交回复
热议问题