Condividi tramite


TcpServerChannel Costruttori

Definizione

Inizializza una nuova istanza della classe TcpServerChannel che è in attesa sulla porta specificata.

Overload

TcpServerChannel(Int32)

Inizializza una nuova istanza della classe TcpServerChannel che è in attesa sulla porta specificata.

TcpServerChannel(IDictionary, IServerChannelSinkProvider)

Inizializza una nuova istanza della classe TcpServerChannel con il sink e le proprietà del canale specificati.

TcpServerChannel(String, Int32)

Inizializza una nuova istanza della classe TcpServerChannel con il nome specificato e in attesa sulla porta specificata.

TcpServerChannel(IDictionary, IServerChannelSinkProvider, IAuthorizeRemotingConnection)

Inizializza una nuova istanza della classe TcpServerChannel con le proprietà di canale, il sink e il provider di autorizzazioni specificati.

TcpServerChannel(String, Int32, IServerChannelSinkProvider)

Inizializza una nuova istanza della classe TcpServerChannel con il nome indicato, che è in attesa sulla porta specificata e utilizza il sink specificato.

TcpServerChannel(Int32)

Inizializza una nuova istanza della classe TcpServerChannel che è in attesa sulla porta specificata.

public:
 TcpServerChannel(int port);
public TcpServerChannel (int port);
new System.Runtime.Remoting.Channels.Tcp.TcpServerChannel : int -> System.Runtime.Remoting.Channels.Tcp.TcpServerChannel
Public Sub New (port As Integer)

Parametri

port
Int32

Porta su cui il canale è in ascolto.

Esempio

Nell'esempio di codice seguente viene illustrato l'uso di questo costruttore.

// Set up a server channel.
TcpServerChannel^ serverChannel = gcnew TcpServerChannel( 9090 );
ChannelServices::RegisterChannel( serverChannel );
// Set up a server channel.
TcpServerChannel serverChannel = new TcpServerChannel(9090);
ChannelServices.RegisterChannel(serverChannel);

Commenti

Per richiedere l'assegnazione dinamica di una porta disponibile, impostare il port parametro su 0 (zero).

Si applica a

TcpServerChannel(IDictionary, IServerChannelSinkProvider)

Inizializza una nuova istanza della classe TcpServerChannel con il sink e le proprietà del canale specificati.

public:
 TcpServerChannel(System::Collections::IDictionary ^ properties, System::Runtime::Remoting::Channels::IServerChannelSinkProvider ^ sinkProvider);
public TcpServerChannel (System.Collections.IDictionary properties, System.Runtime.Remoting.Channels.IServerChannelSinkProvider sinkProvider);
new System.Runtime.Remoting.Channels.Tcp.TcpServerChannel : System.Collections.IDictionary * System.Runtime.Remoting.Channels.IServerChannelSinkProvider -> System.Runtime.Remoting.Channels.Tcp.TcpServerChannel
Public Sub New (properties As IDictionary, sinkProvider As IServerChannelSinkProvider)

Parametri

properties
IDictionary

Insieme IDictionary che specifica i valori per le proprietà di configurazione che vengono utilizzate dal canale.

sinkProvider
IServerChannelSinkProvider

Implementazione di IServerChannelSinkProvider che verrà utilizzata dal canale.

Eccezioni

Una proprietà di canale specificata non è stata formattata correttamente.

Esempio

Nell'esempio di codice seguente viene illustrato l'uso di questo costruttore per creare un TcpServerChannel oggetto con proprietà di configurazione specifiche.

// Specify server channel properties.
IDictionary^ dict = gcnew Hashtable;
dict[ "port" ] = 9090;
dict[ "authenticationMode" ] = "IdentifyCallers";

// Set up a server channel.
TcpServerChannel^ serverChannel = gcnew TcpServerChannel( dict, nullptr );
ChannelServices::RegisterChannel( serverChannel, false );
// Specify server channel properties.
IDictionary dict = new Hashtable();
dict["port"] = 9090;
dict["authenticationMode"] = "IdentifyCallers";

// Set up a server channel.
TcpServerChannel serverChannel = new TcpServerChannel(dict, null);
ChannelServices.RegisterChannel(serverChannel, false);

Commenti

Per altre informazioni sulle proprietà di configurazione del canale, vedere Proprietà di configurazione canale e formattatore.

Nota

Se non è necessaria la funzionalità sink, impostare il sinkProvider parametro su null.

Vedi anche

Si applica a

TcpServerChannel(String, Int32)

Inizializza una nuova istanza della classe TcpServerChannel con il nome specificato e in attesa sulla porta specificata.

public:
 TcpServerChannel(System::String ^ name, int port);
public TcpServerChannel (string name, int port);
new System.Runtime.Remoting.Channels.Tcp.TcpServerChannel : string * int -> System.Runtime.Remoting.Channels.Tcp.TcpServerChannel
Public Sub New (name As String, port As Integer)

Parametri

name
String

Nome del canale.

port
Int32

Porta su cui il canale è in ascolto.

Esempio

Nell'esempio di codice seguente viene illustrato come costruire un TcpServerChanneloggetto .

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

Commenti

Questo costruttore imposta la ChannelName proprietà usando il name parametro . Se si vuole registrare più di un canale, ogni canale deve avere un nome univoco.

Per richiedere l'assegnazione dinamica di una porta disponibile, impostare il port parametro su 0 (zero).

Si applica a

TcpServerChannel(IDictionary, IServerChannelSinkProvider, IAuthorizeRemotingConnection)

Inizializza una nuova istanza della classe TcpServerChannel con le proprietà di canale, il sink e il provider di autorizzazioni specificati.

public:
 TcpServerChannel(System::Collections::IDictionary ^ properties, System::Runtime::Remoting::Channels::IServerChannelSinkProvider ^ sinkProvider, System::Runtime::Remoting::Channels::IAuthorizeRemotingConnection ^ authorizeCallback);
public TcpServerChannel (System.Collections.IDictionary properties, System.Runtime.Remoting.Channels.IServerChannelSinkProvider sinkProvider, System.Runtime.Remoting.Channels.IAuthorizeRemotingConnection authorizeCallback);
new System.Runtime.Remoting.Channels.Tcp.TcpServerChannel : System.Collections.IDictionary * System.Runtime.Remoting.Channels.IServerChannelSinkProvider * System.Runtime.Remoting.Channels.IAuthorizeRemotingConnection -> System.Runtime.Remoting.Channels.Tcp.TcpServerChannel
Public Sub New (properties As IDictionary, sinkProvider As IServerChannelSinkProvider, authorizeCallback As IAuthorizeRemotingConnection)

Parametri

properties
IDictionary

Insieme IDictionary che specifica i valori per le proprietà di configurazione che vengono utilizzate dal canale.

sinkProvider
IServerChannelSinkProvider

Implementazione di IServerChannelSinkProvider che verrà utilizzata dal canale.

authorizeCallback
IAuthorizeRemotingConnection

Implementazione di IAuthorizeRemotingConnection che verrà utilizzata dal canale.

Eccezioni

Una proprietà di canale specificata non è stata formattata correttamente.

Commenti

Per altre informazioni sulle proprietà di configurazione del canale, vedere Proprietà di configurazione canale e formattatore.

Vedi anche

Si applica a

TcpServerChannel(String, Int32, IServerChannelSinkProvider)

Inizializza una nuova istanza della classe TcpServerChannel con il nome indicato, che è in attesa sulla porta specificata e utilizza il sink specificato.

public:
 TcpServerChannel(System::String ^ name, int port, System::Runtime::Remoting::Channels::IServerChannelSinkProvider ^ sinkProvider);
public TcpServerChannel (string name, int port, System.Runtime.Remoting.Channels.IServerChannelSinkProvider sinkProvider);
new System.Runtime.Remoting.Channels.Tcp.TcpServerChannel : string * int * System.Runtime.Remoting.Channels.IServerChannelSinkProvider -> System.Runtime.Remoting.Channels.Tcp.TcpServerChannel
Public Sub New (name As String, port As Integer, sinkProvider As IServerChannelSinkProvider)

Parametri

name
String

Nome del canale.

port
Int32

Porta su cui il canale è in ascolto.

sinkProvider
IServerChannelSinkProvider

Implementazione di IServerChannelSinkProvider che verrà utilizzata dal canale.

Esempio

Nell'esempio di codice seguente viene illustrato come costruire un TcpServerChanneloggetto .

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

Commenti

Questo costruttore imposta la ChannelName proprietà usando il name parametro . Se si vuole registrare più di un canale, ogni canale deve avere un nome univoco.

Per richiedere l'assegnazione dinamica di una porta disponibile, impostare il port parametro su 0 (zero).

Se non è necessaria la funzionalità sink, impostare il sinkProvider parametro su null.

Si applica a