Partager via


TcpServerChannel Constructeurs

Définition

Initialise une nouvelle instance de la classe TcpServerChannel qui écoute sur le port spécifié.

Surcharges

TcpServerChannel(Int32)

Initialise une nouvelle instance de la classe TcpServerChannel qui écoute sur le port spécifié.

TcpServerChannel(IDictionary, IServerChannelSinkProvider)

Initialise une nouvelle instance de la classe TcpServerChannel avec les propriétés de canal et le récepteur spécifiés.

TcpServerChannel(String, Int32)

Initialise une nouvelle instance de la classe TcpServerChannel portant le nom indiqué et à l'écoute sur le port spécifié.

TcpServerChannel(IDictionary, IServerChannelSinkProvider, IAuthorizeRemotingConnection)

Initialise une nouvelle instance de la classe TcpServerChannel avec les propriétés de canal, le récepteur et le fournisseur d'autorisation spécifiés.

TcpServerChannel(String, Int32, IServerChannelSinkProvider)

Initialise une nouvelle instance de la classe TcpServerChannel avec le nom donné, qui écoute sur le port spécifié et utilise le récepteur spécifié.

TcpServerChannel(Int32)

Initialise une nouvelle instance de la classe TcpServerChannel qui écoute sur le port spécifié.

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)

Paramètres

port
Int32

Port sur lequel le canal est à l'écoute.

Exemples

L’exemple de code suivant montre l’utilisation de ce constructeur.

// 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);

Remarques

Pour demander l’attribution dynamique d’un port disponible, définissez le paramètre sur port 0 (zéro).

S’applique à

TcpServerChannel(IDictionary, IServerChannelSinkProvider)

Initialise une nouvelle instance de la classe TcpServerChannel avec les propriétés de canal et le récepteur spécifiés.

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)

Paramètres

properties
IDictionary

Collection IDictionary spécifiant les valeurs des propriétés de configuration devant être utilisées par le canal.

sinkProvider
IServerChannelSinkProvider

Implémentation de IServerChannelSinkProvider devant être utilisée par le canal.

Exceptions

La mise en forme d'une propriété de canal fournie est incorrecte.

Exemples

L’exemple de code suivant montre l’utilisation de ce constructeur pour créer un TcpServerChannel objet avec des propriétés de configuration spécifiques.

// 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);

Remarques

Pour plus d’informations sur les propriétés de configuration de canal, consultez Propriétés de configuration du canal et du formateur.

Notes

Si vous n’avez pas besoin de la fonctionnalité de récepteur, définissez le paramètre sur sinkProvidernull.

Voir aussi

S’applique à

TcpServerChannel(String, Int32)

Initialise une nouvelle instance de la classe TcpServerChannel portant le nom indiqué et à l'écoute sur le port spécifié.

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)

Paramètres

name
String

Nom du canal.

port
Int32

Port sur lequel le canal est à l'écoute.

Exemples

L’exemple de code suivant montre comment construire un TcpServerChannel.

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

Remarques

Ce constructeur définit la propriété à l’aide ChannelName du name paramètre . Si vous souhaitez inscrire plusieurs canaux, chaque canal doit avoir un nom unique.

Pour demander l’attribution dynamique d’un port disponible, définissez le paramètre sur port 0 (zéro).

S’applique à

TcpServerChannel(IDictionary, IServerChannelSinkProvider, IAuthorizeRemotingConnection)

Initialise une nouvelle instance de la classe TcpServerChannel avec les propriétés de canal, le récepteur et le fournisseur d'autorisation spécifiés.

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)

Paramètres

properties
IDictionary

Collection IDictionary qui spécifie les valeurs des propriétés de configuration devant être utilisées par le canal.

sinkProvider
IServerChannelSinkProvider

Implémentation de IServerChannelSinkProvider devant être utilisée par le canal.

authorizeCallback
IAuthorizeRemotingConnection

Implémentation de IAuthorizeRemotingConnection devant être utilisée par le canal.

Exceptions

La mise en forme d'une propriété de canal fournie est incorrecte.

Remarques

Pour plus d’informations sur les propriétés de configuration de canal, consultez Propriétés de configuration du canal et du formateur.

Voir aussi

S’applique à

TcpServerChannel(String, Int32, IServerChannelSinkProvider)

Initialise une nouvelle instance de la classe TcpServerChannel avec le nom donné, qui écoute sur le port spécifié et utilise le récepteur spécifié.

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)

Paramètres

name
String

Nom du canal.

port
Int32

Port sur lequel le canal est à l'écoute.

sinkProvider
IServerChannelSinkProvider

Implémentation de IServerChannelSinkProvider devant être utilisée par le canal.

Exemples

L’exemple de code suivant montre comment construire un 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);

Remarques

Ce constructeur définit la propriété à l’aide ChannelName du name paramètre . Si vous souhaitez inscrire plusieurs canaux, chaque canal doit avoir un nom unique.

Pour demander l’attribution dynamique d’un port disponible, définissez le paramètre sur port 0 (zéro).

Si vous n’avez pas besoin de la fonctionnalité de récepteur, définissez le paramètre sur sinkProvidernull.

S’applique à