Skip to content

Feature InetSocketAddress constructor with ByteArray #4978

@remmerw

Description

@remmerw

Currently a InetSocketAddress can be constructed via a hostname

Source: SocketAddressJvm.kt

public actual constructor(hostname: String, port: Int) :
this(java.net.InetSocketAddress(hostname, port))

Would be nice if there is a constructor with an address array like
public actual constructor(address: ByteArray, port: Int) : {
val inet = InetAddress.getByAddress(address)
this(java.net.InetSocketAddress(inet, port))
}
// Note this is only an example (not sure if that works, only to get the idea)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions