Skip to content

Commit 9711da1

Browse files
authored
Clean up unused code
1 parent 5e75156 commit 9711da1

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

core/src/main/java/com/github/shadowsocks/net/DnsResolverCompat.kt

-10
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ import android.net.DnsResolver
2626
import android.net.Network
2727
import android.os.Build
2828
import android.os.CancellationSignal
29-
import android.os.Looper
3029
import android.system.ErrnoException
31-
import android.system.Os
3230
import com.github.shadowsocks.Core
3331
import com.github.shadowsocks.utils.int
3432
import kotlinx.coroutines.*
@@ -78,8 +76,6 @@ sealed class DnsResolverCompat {
7876

7977
@Throws(IOException::class)
8078
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)
8379
abstract suspend fun resolve(network: Network, host: String): Array<InetAddress>
8480
abstract suspend fun resolveOnActiveNetwork(host: String): Array<InetAddress>
8581
abstract suspend fun resolveRaw(network: Network, query: ByteArray): ByteArray
@@ -100,12 +96,6 @@ sealed class DnsResolverCompat {
10096
throw IOException(message, ErrnoException(message, -err))
10197
}
10298

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-
10999
/**
110100
* This dispatcher is used for noncancellable possibly-forever-blocking operations in network IO.
111101
*

0 commit comments

Comments
 (0)