Added extra `socketAddress` function
This commit is contained in:
parent
6774c8c411
commit
f097cc195b
|
@ -3,6 +3,7 @@
|
|||
package dorkbox.netUtil
|
||||
|
||||
import mu.KotlinLogging
|
||||
import java.net.InetAddress
|
||||
import java.net.InetSocketAddress
|
||||
import java.security.AccessController
|
||||
import java.security.PrivilegedAction
|
||||
|
@ -111,4 +112,8 @@ internal object Common {
|
|||
fun socketAddress(hostname: String, port: Int): InetSocketAddress {
|
||||
return AccessController.doPrivileged<InetSocketAddress>(PrivilegedAction { InetSocketAddress(hostname, port) })
|
||||
}
|
||||
|
||||
fun socketAddress(host: InetAddress, port: Int): InetSocketAddress {
|
||||
return AccessController.doPrivileged<InetSocketAddress>(PrivilegedAction { InetSocketAddress(host, port) })
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue