@@ -26,9 +26,7 @@ import android.net.DnsResolver
26
26
import android.net.Network
27
27
import android.os.Build
28
28
import android.os.CancellationSignal
29
- import android.os.Looper
30
29
import android.system.ErrnoException
31
- import android.system.Os
32
30
import com.github.shadowsocks.Core
33
31
import com.github.shadowsocks.utils.int
34
32
import kotlinx.coroutines.*
@@ -78,8 +76,6 @@ sealed class DnsResolverCompat {
78
76
79
77
@Throws(IOException ::class )
80
78
abstract fun bindSocket (network : Network , socket : FileDescriptor )
81
- internal open suspend fun connectUdp (fd : FileDescriptor , address : InetAddress , port : Int = 0) =
82
- Os .connect(fd, address, port)
83
79
abstract suspend fun resolve (network : Network , host : String ): Array <InetAddress >
84
80
abstract suspend fun resolveOnActiveNetwork (host : String ): Array <InetAddress >
85
81
abstract suspend fun resolveRaw (network : Network , query : ByteArray ): ByteArray
@@ -100,12 +96,6 @@ sealed class DnsResolverCompat {
100
96
throw IOException (message, ErrnoException (message, - err))
101
97
}
102
98
103
- override suspend fun connectUdp (fd : FileDescriptor , address : InetAddress , port : Int ) {
104
- if (Looper .getMainLooper().thread == Thread .currentThread()) withContext(Dispatchers .IO ) { // #2405
105
- super .connectUdp(fd, address, port)
106
- } else super .connectUdp(fd, address, port)
107
- }
108
-
109
99
/* *
110
100
* This dispatcher is used for noncancellable possibly-forever-blocking operations in network IO.
111
101
*
0 commit comments