Stay organized with collections
Save and categorize content based on your preferences.
SocketOption
interface SocketOption<T : Any!>
A socket option associated with a socket.
In the channels
package, the interface defines the setOption
and getOption
methods to set and query the channel's socket options.
Summary
Public methods |
abstract String! |
Returns the name of the socket option.
|
abstract Class<T>! |
Returns the type of the socket option value.
|
Public methods
name
abstract fun name(): String!
Returns the name of the socket option.
Return |
String! |
the name of the socket option |
type
abstract fun type(): Class<T>!
Returns the type of the socket option value.
Return |
Class<T>! |
the type of the socket option value |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# SocketOption\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nSocketOption\n============\n\n```\ninterface SocketOption\u003cT : Any!\u003e\n```\n\n|----------------------------|\n| [java.net.SocketOption](#) |\n\nA socket option associated with a socket.\n\nIn the [channels](../nio/channels/package-summary.html) package, the interface defines the [setOption](../nio/channels/NetworkChannel.html#setOption(java.net.SocketOption,%20java.nio.channels.NetworkChannel.setOption.T)) and [getOption](../nio/channels/NetworkChannel.html#getOption(java.net.SocketOption)) methods to set and query the channel's socket options.\n\nSummary\n-------\n\n| Public methods ||\n|--------------------------------------------------------------------------------------------|------------------------------------------------------------------|\n| abstract [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [name](#name())`()` Returns the name of the socket option. |\n| abstract [Class](../lang/Class.html#)\\\u003cT\\\u003e! | [type](#type())`()` Returns the type of the socket option value. |\n\nPublic methods\n--------------\n\n### name\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun name(): String!\n```\n\nReturns the name of the socket option.\n\n| Return ||\n|-----------------------------------------------------------------------------------|-------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | the name of the socket option |\n\n### type\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun type(): Class\u003cT\u003e!\n```\n\nReturns the type of the socket option value.\n\n| Return ||\n|----------------------------------|-------------------------------------|\n| [Class](../lang/Class.html#)\u003cT\u003e! | the type of the socket option value |"]]