Share via


SocketImpl.SetPerformancePreferences(Int32, Int32, Int32) Method

Definition

Sets performance preferences for this socket.

[Android.Runtime.Register("setPerformancePreferences", "(III)V", "GetSetPerformancePreferences_IIIHandler")]
protected 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).

By default, this method does nothing, unless it is overridden in a sub-class.

Added in 1.5.

Java documentation for java.net.SocketImpl.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.

Applies to