ServicePoint.ConnectionLimit Properti

Definisi

Mendapatkan atau menyetel jumlah maksimum koneksi yang diizinkan pada objek ini ServicePoint .

public:
 property int ConnectionLimit { int get(); void set(int value); };
public int ConnectionLimit { get; set; }
member this.ConnectionLimit : int with get, set
Public Property ConnectionLimit As Integer

Nilai Properti

Jumlah maksimum koneksi yang diperbolehkan pada objek ini ServicePoint .

Pengecualian

Batas koneksi sama dengan atau kurang dari 0.

Contoh

Contoh kode berikut menggunakan ConnectionLimit properti untuk memeriksa jumlah maksimum koneksi yang ServicePoint dapat dilakukan objek ke Pengidentifikasi Sumber Daya Seragam (URI) yang ditentukan.

Console::WriteLine( "ConnectionName = {0}", sp->ConnectionName );

// Display the maximum number of connections allowed on this 
// ServicePoint instance.
Console::WriteLine( "ConnectionLimit = {0}", sp->ConnectionLimit );

// Display the number of connections associated with this 
// ServicePoint instance.
Console::WriteLine( "CurrentConnections = {0}", sp->CurrentConnections );
Console.WriteLine("ConnectionName = " + sp.ConnectionName);

// Display the maximum number of connections allowed on this
// ServicePoint instance.
Console.WriteLine("ConnectionLimit = " + sp.ConnectionLimit);

// Display the number of connections associated with this
// ServicePoint instance.
Console.WriteLine("CurrentConnections = " + sp.CurrentConnections);
Console.WriteLine(("ConnectionName = " + sp.ConnectionName))

' Display the maximum number of connections allowed on this 
' ServicePoint instance.
Console.WriteLine(("ConnectionLimit = " + sp.ConnectionLimit.ToString()))

' Display the number of connections associated with this 
' ServicePoint instance.
Console.WriteLine(("CurrentConnections = " + sp.CurrentConnections.ToString()))

Keterangan

Properti ConnectionLimit mengatur jumlah maksimum koneksi yang ServicePoint dapat dilakukan objek ke sumber daya Internet. Nilai ConnectionLimit properti diatur ke nilai ServicePointManager.DefaultConnectionLimit properti saat ServicePoint objek dibuat; perubahan DefaultConnectionLimit berikutnya tidak berpengaruh pada objek yang ada ServicePoint .

Berlaku untuk

Lihat juga