Socket.SetPerformancePreferences(Int32, Int32, Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets performance preferences for this socket.
[Android.Runtime.Register("setPerformancePreferences", "(III)V", "GetSetPerformancePreferences_IIIHandler")]
public virtual void SetPerformancePreferences (int connectionTime, int latency, int bandwidth);
[<Android.Runtime.Register("setPerformancePreferences", "(III)V", "GetSetPerformancePreferences_IIIHandler")>]
abstract member SetPerformancePreferences : int * int * int -> unit
override this.SetPerformancePreferences : int * int * int -> unit
Parameters
- connectionTime
- Int32
An int
expressing the relative importance of a short
connection time
- latency
- Int32
An int
expressing the relative importance of low
latency
- bandwidth
- Int32
An int
expressing the relative importance of high
bandwidth
- Attributes
Remarks
Sets performance preferences for this socket.
Sockets use the TCP/IP protocol by default. Some implementations may offer alternative protocols which have different performance characteristics than TCP/IP. This method allows the application to express its own preferences as to how these tradeoffs should be made when the implementation chooses from the available protocols.
Performance preferences are described by three integers whose values indicate the relative importance of short connection time, low latency, and high bandwidth. The absolute values of the integers are irrelevant; in order to choose a protocol the values are simply compared, with larger values indicating stronger preferences. Negative values represent a lower priority than positive values. If the application prefers short connection time over both low latency and high bandwidth, for example, then it could invoke this method with the values (1, 0, 0)
. If the application prefers high bandwidth above low latency, and low latency above short connection time, then it could invoke this method with the values (0, 1, 2)
.
Invoking this method after this socket has been connected will have no effect.
Added in 1.5.
Java documentation for java.net.Socket.setPerformancePreferences(int, int, int)
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.