Condividi tramite


TcpServerChannel Costruttori

Definizione

Inizializza una nuova istanza della TcpServerChannel classe in ascolto sulla porta specificata.

Overload

Nome Descrizione
TcpServerChannel(Int32)

Inizializza una nuova istanza della TcpServerChannel classe in ascolto sulla porta specificata.

TcpServerChannel(IDictionary, IServerChannelSinkProvider)

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

TcpServerChannel(String, Int32)

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

TcpServerChannel(IDictionary, IServerChannelSinkProvider, IAuthorizeRemotingConnection)

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

TcpServerChannel(String, Int32, IServerChannelSinkProvider)

Inizializza una nuova istanza della TcpServerChannel classe con il nome specificato, in ascolto sulla porta specificata e usa il sink specificato.

TcpServerChannel(Int32)

Inizializza una nuova istanza della TcpServerChannel classe in ascolto 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 in 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 TcpServerChannel classe con le proprietà e il sink 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

Raccolta IDictionary che specifica i valori per le proprietà di configurazione da utilizzare dal canale.

sinkProvider
IServerChannelSinkProvider

Implementazione IServerChannelSinkProvider da usare dal canale.

Eccezioni

Una proprietà del canale specificata è stata formattata in modo non corretto.

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 del canale e del formattatore.

Annotazioni

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 TcpServerChannel classe con il nome specificato e in ascolto 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 in cui il canale è in ascolto.

Esempio

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

// 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à utilizzando il name parametro . Se si desidera registrare più canali, 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 TcpServerChannel classe con le proprietà del canale, il sink e il provider di autorizzazione 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

Raccolta IDictionary che specifica i valori per le proprietà di configurazione da utilizzare dal canale.

sinkProvider
IServerChannelSinkProvider

Implementazione IServerChannelSinkProvider da usare dal canale.

authorizeCallback
IAuthorizeRemotingConnection

Implementazione IAuthorizeRemotingConnection da usare dal canale.

Eccezioni

Una proprietà del canale specificata è stata formattata in modo non corretto.

Commenti

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

Vedi anche

Si applica a

TcpServerChannel(String, Int32, IServerChannelSinkProvider)

Inizializza una nuova istanza della TcpServerChannel classe con il nome specificato, in ascolto sulla porta specificata e usa 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 in cui il canale è in ascolto.

sinkProvider
IServerChannelSinkProvider

Implementazione IServerChannelSinkProvider da usare dal canale.

Esempio

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

// 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à utilizzando il name parametro . Se si desidera registrare più canali, 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