我有打网络电话的功能。可以同时多次调用它,并且每个调用同时运行。
getDataTask() // it is subscribed on the background thread and observed on the main thread
.subscribe(
{ result -> onResult(result) },
{ onError() }
)
.addToDisposables()
我可以毫无问题地检索数据。onResult函数将ViewModel中的MutableLiveData字段更新为
private v
我需要嗅探5060端口上的网络电话流量。同时,我需要排除src端口5060和dst端口5061的所有包。
我需要像这样的东西:
tcpdump -i any -vvv -s0 port 5060 and (not src port 5060 and not dst port 5061)
但过滤器的第二部分应该与单个数据包相关,而不是所有流量。我该怎么做呢?
有没有一种不打网络电话就能检查互联网连接的方法?欢迎使用库链接!
我看到的所有例子都是这样的:
fun hasInternetConnection(): Single<Boolean> {
return Single.fromCallable {
try {
// Connect to Google DNS to check for connection
val timeoutMs = 1500
val socket = Socket()
val socketAddress = InetSocketAddress("8.8.8.8", 53)