首页 \ 问答 \ 非阻塞DatagramSocket?(Non-blocking DatagramSocket?)

非阻塞DatagramSocket?(Non-blocking DatagramSocket?)

我正在开发一个Android的客户端应用程序,它应该通过UDP进行无阻塞的数据包接收。 有没有办法设置DatagramSocket,以便它的receive()上没有阻塞?

基本上我要问的是如何为DatagramSocket设置MSG_DONTWAIT标志。


I'm currently developing a client application for Android that is supposed to do non-blocking reception of packets through UDP. Is there any way to setup a DatagramSocket so that it is non-blocking on its receive()?

Basically what I'm asking is how to set the MSG_DONTWAIT flag for a DatagramSocket.


原文:https://stackoverflow.com/questions/14609760
更新时间:2023-11-18 14:11

最满意答案

解决方案

ALTER IGNORE TABLE MyTable ADD UNIQUE KEY my_unique_key_name (accountid, reportid,date)

- Mihai 1月29日19:19


Solution Used

ALTER IGNORE TABLE MyTable ADD UNIQUE KEY my_unique_key_name (accountid, reportid,date)

– Mihai Jan 29 at 19:19

相关问答

更多
  • 我们可以使用dplyr::summarise_all (1)平均值 library(tidyverse) df2 <- df1 %>% group_by(gene) %>% summarise_all(mean) df2; ## A tibble: 6 x 4 # gene int_1 int_2 int_3 # #1 Ard 15.0 114. 65.0 #2 Esr 211. 36. 34.7 #3 Mkp ...
  • 是的,让MySQL搞清楚。 它已经知道下一个可能的值是什么,并且会比你更快地选择它。 您的select方法不仅会失败,还会涉及到服务器的两次往返而不是一次。 更不用说让服务器弄清楚它会给它提供更多的优化机会。 Yes, just let MySQL figure it out. It already knows what the next possible value is and will pick it much faster than you can. Not only could your sele ...
  • 不过我的算法