Skip to content

Commit

Permalink
tweak: decrease connect timeout to 5s
Browse files Browse the repository at this point in the history
  • Loading branch information
Ink committed Apr 21, 2024
1 parent d5f75dd commit bba871f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.damn.anotherglass.shared.rpc.RPCMessage
import com.damn.anotherglass.shared.rpc.RPCMessageListener
import java.io.ObjectInputStream
import java.io.ObjectOutputStream
import java.net.InetSocketAddress
import java.net.Socket
import java.net.SocketException
import java.util.concurrent.BlockingQueue
Expand Down Expand Up @@ -60,7 +61,8 @@ class WiFiClient : IRPCClient {
override fun run() {
mHandler.onWaiting()
try {
Socket(ip, Constants.defaultPort).use { socket ->
Socket().use { socket ->
socket.connect(InetSocketAddress(ip, Constants.defaultPort), 5000)
mHandler.onConnectionStarted(socket.inetAddress.toString())
runLoop(socket)
}
Expand Down

0 comments on commit bba871f

Please sign in to comment.