다음을 통해 공유


ServerSocket.SetPerformancePreferences(Int32, Int32, Int32) Method

Definition

Sets performance preferences for this ServerSocket.

[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 ServerSocket.

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. 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 bound will have no effect. This implies that in order to use this capability requires the socket to be created with the no-argument constructor.

Added in 1.5.

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