次の方法で共有


TcpServerChannel コンストラクタ (String, Int32)

指定した名前を持ち、指定したポートを待ち受ける、TcpServerChannel クラスの新しいインスタンスを初期化します。

名前空間: System.Runtime.Remoting.Channels.Tcp
アセンブリ: System.Runtime.Remoting (system.runtime.remoting.dll 内)

構文

'宣言
Public Sub New ( _
    name As String, _
    port As Integer _
)
'使用
Dim name As String
Dim port As Integer

Dim instance As New TcpServerChannel(name, port)
public TcpServerChannel (
    string name,
    int port
)
public:
TcpServerChannel (
    String^ name, 
    int port
)
public TcpServerChannel (
    String name, 
    int port
)
public function TcpServerChannel (
    name : String, 
    port : int
)

パラメータ

  • name
    チャネルの名前。
  • port
    チャネルの待機ポート。

解説

このコンストラクタは、name パラメータを使用して ChannelName プロパティを設定します。複数のチャネルを登録する場合は、各チャネルに一意の名前を付ける必要があります。

動的に割り当てられる利用可能なポートを要求するには、port パラメータに 0 (ゼロ) を設定します。

使用例

TcpServerChannel の構築方法を次のコード例に示します。

// Create the server channel.
TcpServerChannel channel = new TcpServerChannel(
    "Server Channel", 9090);
// Create the server channel.
TcpServerChannel^ channel = gcnew TcpServerChannel( "Server Channel",9090 );

.NET Framework のセキュリティ

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「」を参照してください。

プラットフォーム

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 2.0、1.1、1.0

参照

関連項目

TcpServerChannel クラス
TcpServerChannel メンバ
System.Runtime.Remoting.Channels.Tcp 名前空間