remove port management

This commit is contained in:
Jonathan Fisher 2020-11-17 09:49:47 +00:00
parent 02c67bda89
commit 864cb62eb7
1 changed files with 2 additions and 3 deletions

View File

@ -77,7 +77,6 @@ class GeminiDatasource(private val context: Context, val history: ArianeHistory)
}
private fun geminiRequest(uri: URI, onUpdate: (state: GemState) -> Unit){
val port = if(uri.port == -1) 1965 else uri.port
//todo - extract and reuse this ------------------------------------------------------------
val protocol = prefs.getString("tls_protocol", "TLS")
@ -97,7 +96,7 @@ class GeminiDatasource(private val context: Context, val history: ArianeHistory)
val socket: SSLSocket?
try {
socket = factory.createSocket(uri.host, port) as SSLSocket
socket = factory.createSocket(uri.host, 1965) as SSLSocket
when (protocol) {
"TLS" -> {}//Use default enabled protocols
@ -105,7 +104,7 @@ class GeminiDatasource(private val context: Context, val history: ArianeHistory)
else -> socket.enabledProtocols = arrayOf(protocol)
}
println("Ariane socket handshake with ${uri.host} on port $port")
println("Ariane socket handshake with ${uri.host}")
socket.startHandshake()
}catch (ce: ConnectException){
println("Ariane socket error: $ce")