アクセスポイント
【英】AP, SP, Access Point, Service Point
アクセスポイントとは、電話回線や無線LANを用いてネットワークに接続する際の接続先のことである。
電話回線におけるアクセスポイントは、インターネットサービスプロバイダ(ISP)やパソコン通信サービス提供会社などが全国各所に設けた機器であり、ユーザーはコンピュータに接続されたアナログ回線やISDN回線などの電話回線を使ってアクセスポイントまで電話をかける(ダイヤルアップ)ことによってネットワークに接続することができる。
ADSLやFTTHなどのブロードバンドが普及したことでダイヤルアップでネットワークに接続するユーザーは減っており、電話回線を用いたアクセスポイントは統廃合が進んでいる。
無線LANにおけるアクセスポイントとは、無線LAN機器を搭載したコンピュータを有線のネットワーク(有線LAN)に接続する際の接続先もしくは機器同士を接続する場合の接続先のことを指す。こちらは特に無線LANアクセスポイントと呼ばれることが多い。
ServicePoint クラス
アセンブリ: System (system.dll 内)


ServicePoint クラスは、インターネット リソースの URI (Uniform Resource Identifier) で渡されたホスト情報に基づいて、そのリソースへの接続を処理します。リソースへの初期接続で、ServicePoint オブジェクトによって保持される情報が決定されます。この情報は、以降のそのリソースに対するすべての要求によって共有されます。
ServicePoint オブジェクトは、ServicePointManager クラスによって管理され、必要に応じて System.Net.ServicePointManager.FindServicePoint メソッドによって作成されます。作成できる ServicePoint オブジェクトの最大数は、ServicePointManager.MaxServicePoints プロパティで設定します。
各 ServicePoint オブジェクトは、アイドル時間が MaxIdleTime プロパティで指定された時間を超えるまで、インターネット リソースへの接続を維持します。ServicePoint は、MaxIdleTime 値を超過したら、別の接続で再利用できます。MaxIdleTime の既定値は、ServicePointManager.MaxServicePointIdleTime プロパティで設定します。
ConnectionLeaseTimeout プロパティが -1 以外の値に設定されている場合、指定した時間が経過すると、アクティブな ServicePoint 接続は、次の要求の処理後に閉じられます。これは、無制限に開いているアクティブな接続を必要としないアプリケーションに便利です。既定では、アクティブな接続は無制限に開いています。
![]() |
---|
負荷の高い状況では、一部のアプリケーションが ThreadPool 内のフリー スレッドを使い果たし、システムのパフォーマンスが低下することがあります (トランザクションの数が多い場合や変化する場合など)。この問題を解決するための構成変更については、http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/scalenetchapt17.asp を参照してください。 |

www.contoso.com という URI に接続する ServicePoint オブジェクトを作成するコード例を次に示します。
' This example shows how to use the ServicePoint and ServicePointManager classes. ' The ServicePointManager class uses the ServicePoint class to manage connections ' to a remote host. The networking classes reuse service points for all ' requests to a given URI. In fact, the same ServicePoint object ' is used to issue requests to Internet resources identified by the same ' scheme identifier (for example, HTTP) and host fragment (for example, www.contoso.com). ' Reusing service points in this way can help improve application performance. Imports System Imports System.Net Imports System.Threading Imports System.Text.RegularExpressions Namespace Mssc.Services.ConnectionManagement Module M_TestServicePoint Class TestServicePoint Private Shared Sub ShowProperties(ByVal sp As ServicePoint) Console.WriteLine("Done calling FindServicePoint") ' Display the ServicePoint Internet resource address. Console.WriteLine(("Address = " + sp.Address.ToString())) ' Display the date and time that the ServicePoint was last ' connected to a host. Console.WriteLine(("IdleSince = " + sp.IdleSince.ToString())) ' Display the maximum length of time that the ServicePoint instance ' is allowed to maintain an idle connection to an Internet ' resource before it is recycled for use in another connection. Console.WriteLine(("MaxIdleTime = " + sp.MaxIdleTime.ToString())) 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())) If sp.Certificate Is Nothing Then Console.WriteLine("Certificate = (null)") Else Console.WriteLine(("Certificate = " + sp.Certificate.ToString())) End If If sp.ClientCertificate Is Nothing Then Console.WriteLine("ClientCertificate = (null)") Else Console.WriteLine(("ClientCertificate = " + sp.ClientCertificate.ToString())) End If Console.WriteLine("ProtocolVersion = " + sp.ProtocolVersion.ToString()) Console.WriteLine(("SupportsPipelining = " + sp.SupportsPipelining.ToString())) Console.WriteLine("UseNagleAlgorithm = " + sp.UseNagleAlgorithm.ToString()) Console.WriteLine("Expect 100-continue = " + sp.Expect100Continue.ToString()) End Sub 'ShowProperties Private Shared Sub makeWebRequest(ByVal hashCode As Integer, ByVal Uri As String) Dim res As HttpWebResponse = Nothing ' Make sure that the idle time has elapsed, so that a new ' ServicePoint instance is created. Console.WriteLine("Sleeping for 2 sec.") Thread.Sleep(2000) Try ' Create a request to the passed URI. Dim req As HttpWebRequest = CType(WebRequest.Create(Uri), HttpWebRequest) Console.WriteLine((ControlChars.Lf + "Connecting to " + Uri + " ............")) ' Get the response object. res = CType(req.GetResponse(), HttpWebResponse) Console.WriteLine("Connected." + ControlChars.Lf) Dim currentServicePoint As ServicePoint = req.ServicePoint ' Display new service point properties. Dim currentHashCode As Integer = currentServicePoint.GetHashCode() Console.WriteLine(("New service point hashcode: " + currentHashCode.ToString())) Console.WriteLine(("New service point max idle time: " + currentServicePoint.MaxIdleTime.ToString())) Console.WriteLine(("New service point is idle since " + currentServicePoint.IdleSince.ToString())) ' Check that a new ServicePoint instance has been created. If hashCode = currentHashCode Then Console.WriteLine("Service point reused.") Else Console.WriteLine("A new service point created.") End If Catch e As Exception Console.WriteLine(("Source : " + e.Source)) Console.WriteLine(("Message : " + e.Message)) Finally If Not (res Is Nothing) Then res.Close() End If End Try End Sub 'makeWebRequest ' Show the user how to use this program when wrong inputs are entered. Private Shared Sub showUsage() Console.WriteLine("Enter the proxy name as follows:") Console.WriteLine(ControlChars.Tab + "vb_servicepoint proxyName") End Sub 'showusage ' This is the program entry point. It allows the user to enter ' a server name that is used to locate its current homepage. Public Shared Sub Main(ByVal args() As String) Dim proxy As String = Nothing Dim port As Integer = 80 ' Define a regular expression to parse the user's input. ' This is a security check. It allows only ' alphanumeric input strings between 2 to 40 characters long. Dim rex As New Regex("^[a-zA-Z]\w{1,39}$") If args.Length = 0 Then ' Show how to use this program. showUsage() Return End If proxy = args(0) If (Not (rex.Match(proxy)).Success) Then Console.WriteLine("Input string format not allowed.") Return End If ' Create a proxy object. Dim proxyAdd As String proxyAdd = "http://" + proxy + ":" + port.ToString() Dim DefaultProxy As New WebProxy(proxyAdd, True) ' Set the proxy that all HttpWebRequest instances use. GlobalProxySelection.Select = DefaultProxy ' Get the base interface for proxy access for the ' WebRequest-based classes. Dim Iproxy As IWebProxy = GlobalProxySelection.Select ' Set the maximum number of ServicePoint instances to maintain. ' Note that, if a ServicePoint instance for that host already ' exists when your application requests a connection to ' an Internet resource, the ServicePointManager object ' returns this existing ServicePoint. If none exists ' for that host, it creates a new ServicePoint instance. ServicePointManager.MaxServicePoints = 4 ' Set the maximum idle time of a ServicePoint instance to 10 seconds. ' After the idle time expires, the ServicePoint object is eligible for ' garbage collection and cannot be used by the ServicePointManager. ServicePointManager.MaxServicePointIdleTime = 10000 ServicePointManager.UseNagleAlgorithm = True ServicePointManager.Expect100Continue = True ServicePointManager.CheckCertificateRevocationList = True ServicePointManager.DefaultConnectionLimit = _ ServicePointManager.DefaultPersistentConnectionLimit ' Create the Uri object for the resource you want to access. Dim MS As New Uri("http://msdn.microsoft.com/") ' Use the FindServicePoint method to find an existing ' ServicePoint object or to create a new one. Dim servicePoint As ServicePoint = ServicePointManager.FindServicePoint(MS, Iproxy) ShowProperties(servicePoint) Dim hashCode As Integer = servicePoint.GetHashCode() Console.WriteLine(("Service point hashcode: " + hashCode.ToString())) ' Make a request with the same scheme identifier and host fragment ' used to create the previous ServicePoint object. makeWebRequest(hashCode, "http://msdn.microsoft.com/library/") End Sub 'Main End Class 'TestServicePoint End Module End Namespace
// This example shows how to use the ServicePoint and ServicePointManager classes. // The ServicePointManager class uses the ServicePoint class to manage connections // to a remote host. The networking classes reuse service points for all // requests to a given URI. In fact, the same ServicePoint object // is used to issue requests to Internet resources identified by the same // scheme identifier (for example, HTTP) and host fragment (for example, www.contoso.com). // This should improve your application performance. // Reusing service points in this way can help improve application performance. using System; using System.Net; using System.Threading; using System.Text.RegularExpressions; namespace Mssc.Services.ConnectionManagement { class TestServicePoint { private static void ShowProperties (ServicePoint sp) { Console.WriteLine ("Done calling FindServicePoint()..."); // Display the ServicePoint Internet resource address. Console.WriteLine ("Address = {0} ", sp.Address.ToString ()); // Display the date and time that the ServicePoint was last // connected to a host. Console.WriteLine ("IdleSince = " + sp.IdleSince.ToString ()); // Display the maximum length of time that the ServicePoint instance // is allowed to maintain an idle connection to an Internet // resource before it is recycled for use in another connection. Console.WriteLine ("MaxIdleTime = " + sp.MaxIdleTime); 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); if (sp.Certificate == null) Console.WriteLine ("Certificate = (null)"); else Console.WriteLine ("Certificate = " + sp.Certificate.ToString ()); if (sp.ClientCertificate == null) Console.WriteLine ("ClientCertificate = (null)"); else Console. WriteLine ("ClientCertificate = " + sp.ClientCertificate.ToString ()); Console.WriteLine ("ProtocolVersion = " + sp.ProtocolVersion.ToString ()); Console.WriteLine ("SupportsPipelining = " + sp.SupportsPipelining); Console.WriteLine ("UseNagleAlgorithm = " + sp.UseNagleAlgorithm.ToString ()); Console.WriteLine ("Expect 100-continue = " + sp.Expect100Continue.ToString ()); } private static void makeWebRequest (int hashCode, string Uri) { HttpWebResponse res = null; // Make sure that the idle time has elapsed, so that a new // ServicePoint instance is created. Console.WriteLine ("Sleeping for 2 sec."); Thread.Sleep (2000); try { // Create a request to the passed URI. HttpWebRequest req = (HttpWebRequest)WebRequest.Create (Uri); Console.WriteLine ("\nConnecting to " + Uri + " ............"); // Get the response object. res = (HttpWebResponse)req.GetResponse (); Console.WriteLine ("Connected.\n"); ServicePoint currentServicePoint = req.ServicePoint; // Display new service point properties. int currentHashCode = currentServicePoint.GetHashCode (); Console.WriteLine ("New service point hashcode: " + currentHashCode); Console.WriteLine ("New service point max idle time: " + currentServicePoint.MaxIdleTime); Console.WriteLine ("New service point is idle since " + currentServicePoint.IdleSince ); // Check that a new ServicePoint instance has been created. if (hashCode == currentHashCode) Console.WriteLine ("Service point reused."); else Console.WriteLine ("A new service point created.") ; } catch (Exception e) { Console.WriteLine ("Source : " + e.Source); Console.WriteLine ("Message : " + e.Message); } finally { if (res != null) res.Close (); } } // Show the user how to use this program when wrong inputs are entered. private static void showUsage () { Console.WriteLine ("Enter the proxy name as follows:"); Console.WriteLine ("\tcs_servicepoint proxyName"); } public static void Main (string[] args) { int port = 80; // Define a regular expression to parse the user's input. // This is a security check. It allows only // alphanumeric input strings between 2 to 40 characters long. Regex rex = new Regex (@"^[a-zA-Z]\w{1,39}$"); if (args.Length < 1) { showUsage (); return; } string proxy = args[0]; if ((rex.Match (proxy)).Success != true) { Console.WriteLine ("Input string format not allowed."); return; } string proxyAdd = "http://" + proxy + ":" + port; // Create a proxy object. WebProxy DefaultProxy = new WebProxy (proxyAdd, true); // Set the proxy that all HttpWebRequest instances use. GlobalProxySelection.Select = DefaultProxy; // Get the base interface for proxy access for the // WebRequest-based classes. IWebProxy Iproxy = GlobalProxySelection.Select; // Set the maximum number of ServicePoint instances to // maintain. If a ServicePoint instance for that host already // exists when your application requests a connection to // an Internet resource, the ServicePointManager object // returns this existing ServicePoint instance. If none exists // for that host, it creates a new ServicePoint instance. ServicePointManager.MaxServicePoints = 4; // Set the maximum idle time of a ServicePoint instance to 10 seconds. // After the idle time expires, the ServicePoint object is eligible for // garbage collection and cannot be used by the ServicePointManager object. ServicePointManager.MaxServicePointIdleTime = 10000; ServicePointManager.UseNagleAlgorithm = true; ServicePointManager.Expect100Continue = true; ServicePointManager.CheckCertificateRevocationList = true; ServicePointManager.DefaultConnectionLimit = ServicePointManager.DefaultPersistentConnectionLimit; // Create the Uri object for the resource you want to access. Uri MS = new Uri ("http://msdn.microsoft.com/"); // Use the FindServicePoint method to find an existing // ServicePoint object or to create a new one. ServicePoint servicePoint = ServicePointManager.FindServicePoint (MS, Iproxy); ShowProperties (servicePoint); int hashCode = servicePoint.GetHashCode (); Console.WriteLine ("Service point hashcode: " + hashCode); // Make a request with the same scheme identifier and host fragment // used to create the previous ServicePoint object. makeWebRequest (hashCode, "http://msdn.microsoft.com/library/"); } } }
// This example shows how to use the ServicePoint and ServicePointManager classes. // The ServicePointManager class uses the ServicePoint class to manage connections // to a remote host. The networking classes reuse service points for all // requests to a given URI. In fact, the same ServicePoint object // is used to issue requests to Internet resources identified by the same // scheme identifier (for example, HTTP) and host fragment (for example, www.contoso.com). // This should improve your application performance. // Reusing service points in this way can help improve application performance. #using <System.dll> using namespace System; using namespace System::Net; using namespace System::Threading; using namespace System::Text::RegularExpressions; void ShowProperties( ServicePoint^ sp ) { Console::WriteLine( "Done calling FindServicePoint()..." ); // Display the ServicePoint Internet resource address. Console::WriteLine( "Address = {0}", sp->Address ); // Display the date and time that the ServicePoint was last // connected to a host. Console::WriteLine( "IdleSince = {0}", sp->IdleSince ); // Display the maximum length of time that the ServicePoint instance // is allowed to maintain an idle connection to an Internet // resource before it is recycled for use in another connection. Console::WriteLine( "MaxIdleTime = {0}", sp->MaxIdleTime ); 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 ); if ( sp->Certificate == nullptr ) Console::WriteLine( "Certificate = (null)" ); else Console::WriteLine( "Certificate = {0}", sp->Certificate ); if ( sp->ClientCertificate == nullptr ) Console::WriteLine( "Client Certificate = (null)" ); else Console::WriteLine( "Client Certificate = {0}", sp->ClientCertificate ); Console::WriteLine( "ProtocolVersion = {0}", sp->ProtocolVersion->ToString() ); Console::WriteLine( "SupportsPipelining = {0}", sp->SupportsPipelining ); Console::WriteLine( "UseNagleAlgorithm = {0} ", sp->UseNagleAlgorithm.ToString() ); Console::WriteLine( "Expect 100-continue = {0}", sp->Expect100Continue.ToString() ); } void makeWebRequest( int hashCode, String^ Uri ) { HttpWebResponse^ res = nullptr; // Make sure that the idle time has elapsed, so that a new // ServicePoint instance is created. Console::WriteLine( "Sleeping for 2 sec." ); Thread::Sleep( 2000 ); try { // Create a request to the passed URI. HttpWebRequest^ req = dynamic_cast<HttpWebRequest^>(WebRequest::Create( Uri )); Console::WriteLine( "\nConnecting to {0} ............", Uri ); // Get the response object. res = dynamic_cast<HttpWebResponse^>(req->GetResponse()); Console::WriteLine( "Connected.\n" ); ServicePoint^ currentServicePoint = req->ServicePoint; // Display new service point properties. int currentHashCode = currentServicePoint->GetHashCode(); Console::WriteLine( "New service point hashcode: {0}", currentHashCode ); Console::WriteLine( "New service point max idle time: {0}", currentServicePoint->MaxIdleTime ); Console::WriteLine( "New service point is idle since {0}", currentServicePoint->IdleSince ); // Check that a new ServicePoint instance has been created. if ( hashCode == currentHashCode ) Console::WriteLine( "Service point reused." ); else Console::WriteLine( "A new service point created." ); } catch ( Exception^ e ) { Console::WriteLine( "Source : {0}", e->Source ); Console::WriteLine( "Message : {0}", e->Message ); } finally { if ( res != nullptr ) res->Close(); } } // Show the user how to use this program when wrong inputs are entered. void showUsage() { Console::WriteLine( "Enter the proxy name as follows:" ); Console::WriteLine( "\tcs_servicepoint proxyName" ); } int main() { array<String^>^args = Environment::GetCommandLineArgs(); int port = 80; // Define a regular expression to parse the user's input. // This is a security check. It allows only // alphanumeric input strings between 2 to 40 characters long. Regex^ rex = gcnew Regex( "^[a-zA-Z]\\w{1,39}$" ); if ( args->Length < 2 ) { showUsage(); return -1; } String^ proxy = args[ 1 ]; if ( (rex->Match(proxy))->Success != true ) { Console::WriteLine( "Input string format not allowed." ); return -1; } String^ proxyAdd = String::Format( "http://{0}:{1}", proxy, port ); // Create a proxy object. WebProxy^ DefaultProxy = gcnew WebProxy( proxyAdd,true ); // Set the proxy that all HttpWebRequest instances use. GlobalProxySelection::Select = DefaultProxy; // Get the base interface for proxy access for the // WebRequest-based classes. IWebProxy^ Iproxy = GlobalProxySelection::Select; // Set the maximum number of ServicePoint instances to // maintain. If a ServicePoint instance for that host already // exists when your application requests a connection to // an Internet resource, the ServicePointManager object // returns this existing ServicePoint instance. If none exists // for that host, it creates a new ServicePoint instance. ServicePointManager::MaxServicePoints = 4; // Set the maximum idle time of a ServicePoint instance to 10 seconds. // After the idle time expires, the ServicePoint object is eligible for // garbage collection and cannot be used by the ServicePointManager. ServicePointManager::MaxServicePointIdleTime = 10000; ServicePointManager::UseNagleAlgorithm = true; ServicePointManager::Expect100Continue = true; ServicePointManager::CheckCertificateRevocationList = true; ServicePointManager::DefaultConnectionLimit = ServicePointManager::DefaultPersistentConnectionLimit; // Create the Uri object for the resource you want to access. Uri^ MS = gcnew Uri( "http://msdn.microsoft.com/" ); // Use the FindServicePoint method to find an existing // ServicePoint object or to create a new one. ServicePoint^ servicePoint = ServicePointManager::FindServicePoint( MS, Iproxy ); ShowProperties( servicePoint ); int hashCode = servicePoint->GetHashCode(); Console::WriteLine( "Service point hashcode: {0}", hashCode ); // Make a request with the same scheme identifier and host fragment // used to create the previous ServicePoint object. makeWebRequest( hashCode, "http://msdn.microsoft.com/library/" ); }
package Mssc.Services.ConnectionManagement ; // This example shows how to use the ServicePoint and ServicePointManager // classes. The ServicePointManager class uses the ServicePoint class to // manage connections to a remote host. The networking classes reuse service // points for all requests to a given URI. In fact, the same ServicePoint // object is used to issue requests to Internet resources identified by the // same scheme identifier (for example, HTTP) and host fragment (for example, // www.contoso.com). // This should improve your application performance. // Reusing service points in this way can help improve application performance. import System.*; import System.Net.*; import System.Threading.*; import System.Text.RegularExpressions.*; class TestServicePoint { private static void ShowProperties(ServicePoint sp) { Console.WriteLine("Done calling FindServicePoint()..."); // Display the ServicePoint Internet resource address. Console.WriteLine("Address = {0} ", sp.get_Address().ToString()); // Display the date and time that the ServicePoint was last // connected to a host. Console.WriteLine(("IdleSince = " + sp.get_IdleSince().ToString())); // Display the maximum length of time that the ServicePoint instance // is allowed to maintain an idle connection to an Internet // resource before it is recycled for use in another connection. Console.WriteLine(("MaxIdleTime = " + sp.get_MaxIdleTime())); Console.WriteLine(("ConnectionName = " + sp.get_ConnectionName())); // Display the maximum number of connections allowed on this // ServicePoint instance. Console.WriteLine(("ConnectionLimit = " + sp.get_ConnectionLimit())); // Display the number of connections associated with this // ServicePoint instance. Console.WriteLine(("CurrentConnections = " + sp.get_CurrentConnections())); if (sp.get_Certificate() == null) { Console.WriteLine("Certificate = (null)"); } else { Console.WriteLine(("Certificate = " + sp.get_Certificate().ToString())); } if (sp.get_ClientCertificate() == null) { Console.WriteLine("ClientCertificate = (null)"); } else { Console.WriteLine(("ClientCertificate = " + sp.get_ClientCertificate().ToString())); } Console.WriteLine(("ProtocolVersion = " + sp.get_ProtocolVersion().ToString())); Console.WriteLine(("SupportsPipelining = " + sp.get_SupportsPipelining())); Console.WriteLine(("UseNagleAlgorithm = " + System.Convert.ToString(sp.get_UseNagleAlgorithm()))); Console.WriteLine(("Expect 100-continue = " + System.Convert.ToString(sp.get_Expect100Continue()))); } //ShowProperties private static void MakeWebRequest(int hashCode, String uri) throws InterruptedException { HttpWebResponse res = null; // Make sure that the idle time has elapsed, so that a new // ServicePoint instance is created. Console.WriteLine("Sleeping for 2 sec."); Thread.sleep(2000); try { // Create a request to the passed URI. HttpWebRequest req = ((HttpWebRequest)(WebRequest.Create(uri))); Console.WriteLine(("\nConnecting to " + uri + " ............")); // Get the response object. res = ((HttpWebResponse)(req.GetResponse())); Console.WriteLine("Connected.\n"); ServicePoint currentServicePoint = req.get_ServicePoint(); // Display new service point properties. int currentHashCode = currentServicePoint.GetHashCode(); Console.WriteLine(("New service point hashcode: " + currentHashCode)); Console.WriteLine(("New service point max idle time: " + currentServicePoint.get_MaxIdleTime())); Console.WriteLine(("New service point is idle since " + currentServicePoint.get_IdleSince())); // Check that a new ServicePoint instance has been created. if (hashCode == currentHashCode) { Console.WriteLine("Service point reused."); } else { Console.WriteLine("A new service point created."); } } catch (System.Exception e) { Console.WriteLine(("Source : " + e.get_Source())); Console.WriteLine(("Message : " + e.get_Message())); } finally { if ( res != null ) { res.Close(); } } } //MakeWebRequest // Show the user how to use this program when wrong inputs are entered. private static void ShowUsage() { Console.WriteLine("Enter the proxy name as follows:"); Console.WriteLine("\tcs_servicepoint proxyName"); } //ShowUsage public static void main(String[] args) throws InterruptedException { int port = 80; // Define a regular expression to parse the user's input. // This is a security check. It allows only // alphanumeric input strings between 2 to 40 characters long. Regex rex = new Regex("^[a-zA-Z]\\w{1,39}$"); if (args.length < 1) { ShowUsage(); return; } String proxy = args[0]; if (rex.Match(proxy).get_Success() != true) { Console.WriteLine("Input string format not allowed."); return; } String proxyAdd = "http://" + proxy + ":" + port; // Create a proxy object. WebProxy defaultProxy = new WebProxy(proxyAdd, true); // Set the proxy that all HttpWebRequest instances use. GlobalProxySelection.set_Select(defaultProxy); // Get the base interface for proxy access for the // WebRequest-based classes. IWebProxy iProxy = GlobalProxySelection.get_Select(); // Set the maximum number of ServicePoint instances to // maintain. If a ServicePoint instance for that host already // exists when your application requests a connection to // an Internet resource, the ServicePointManager object // returns this existing ServicePoint instance. If none exists // for that host, it creates a new ServicePoint instance. ServicePointManager.set_MaxServicePoints(4); // Set the maximum idle time of a ServicePoint instance to 10 seconds. // After the idle time expires, the ServicePoint object is eligible // for garbage collection and cannot be used by the ServicePointManager // object. ServicePointManager.set_MaxServicePointIdleTime(10000); ServicePointManager.set_UseNagleAlgorithm(true); ServicePointManager.set_Expect100Continue(true); ServicePointManager.set_CheckCertificateRevocationList(true); ServicePointManager.set_DefaultConnectionLimit( ServicePointManager.DefaultPersistentConnectionLimit); // Create the Uri object for the resource you want to access. Uri ms = new Uri("http://msdn.microsoft.com/"); // Use the FindServicePoint method to find an existing // ServicePoint object or to create a new one. ServicePoint servicePoint = ServicePointManager.FindServicePoint(ms, iProxy); ShowProperties(servicePoint); int hashCode = servicePoint.GetHashCode(); Console.WriteLine(("Service point hashcode: " + hashCode)); // Make a request with the same scheme identifier and host fragment // used to create the previous ServicePoint object. MakeWebRequest(hashCode, "http://msdn.microsoft.com/library/"); } //main } //TestServicePoint

System.Net.ServicePoint


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ServicePoint プロパティ

名前 | 説明 | |
---|---|---|
![]() ![]() | BindIPEndPointDelegate | ローカルの IPEndPoint を ServicePoint に関連付けるデリゲートを指定します。 |
![]() ![]() | ClientCertificate | サーバーに送信された最後のクライアント証明書を取得します。 |
![]() | ConnectionLeaseTimeout | アクティブな ServicePoint 接続が閉じられるまでのミリ秒単位の時間を取得または設定します。 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | ReceiveBufferSize | この ServicePoint が使用するソケットの受信バッファのサイズを取得または設定します。 |
![]() ![]() | UseNagleAlgorithm | その ServicePoint オブジェクトが管理する接続で Nagle アルゴリズムを使用するかどうかを決定する Boolean 値を取得または設定します。 |

ServicePoint メソッド

名前 | 説明 | |
---|---|---|
![]() | CloseConnectionGroup | 指定した接続グループを ServicePoint オブジェクトから削除します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

ServicePoint メンバ
ServicePoint データ型で公開されるメンバを以下の表に示します。

名前 | 説明 | |
---|---|---|
![]() ![]() | BindIPEndPointDelegate | ローカルの IPEndPoint を ServicePoint に関連付けるデリゲートを指定します。 |
![]() ![]() | ClientCertificate | サーバーに送信された最後のクライアント証明書を取得します。 |
![]() | ConnectionLeaseTimeout | アクティブな ServicePoint 接続が閉じられるまでのミリ秒単位の時間を取得または設定します。 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | ReceiveBufferSize | この ServicePoint が使用するソケットの受信バッファのサイズを取得または設定します。 |
![]() ![]() | UseNagleAlgorithm | その ServicePoint オブジェクトが管理する接続で Nagle アルゴリズムを使用するかどうかを決定する Boolean 値を取得または設定します。 |

名前 | 説明 | |
---|---|---|
![]() | CloseConnectionGroup | 指定した接続グループを ServicePoint オブジェクトから削除します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

サービスポイント
ラリー競技中に損傷したラリー車を修復してよい場所を主催者が定めている場合に、その場所をサービスポイントという。国内ラリーでは、レストコントロールポイントと合わせてサービスポイントが設定されることが多い。許される一定時間内に、サービスクルーのメカニックが修復作業を行う。国内ラリーでは、1イベントで2、3箇所設定される。かつては、修復できる作業内容がきわめて限られていたが、最近では、競技技術委員長の判断により、トランスミッション交換などかなり広範囲のサービス作業ができるようになった。
「Service Point」の例文・使い方・用例・文例
- 米国陸軍士官学校 《West Point にある》.
- ServicePointのページへのリンク