Bewerken

Delen via


TcpServerChannel Constructors

Definition

Initializes a new instance of the TcpServerChannel class that listens on the specified port.

Overloads

TcpServerChannel(Int32)

Initializes a new instance of the TcpServerChannel class that listens on the specified port.

TcpServerChannel(IDictionary, IServerChannelSinkProvider)

Initializes a new instance of the TcpServerChannel class with the specified channel properties and sink.

TcpServerChannel(String, Int32)

Initializes a new instance of the TcpServerChannel class with the given name and that listens on the specified port.

TcpServerChannel(IDictionary, IServerChannelSinkProvider, IAuthorizeRemotingConnection)

Initializes a new instance of the TcpServerChannel class with the specified channel properties, sink, and authorization provider.

TcpServerChannel(String, Int32, IServerChannelSinkProvider)

Initializes a new instance of the TcpServerChannel class with the given name, which listens on the specified port, and uses the specified sink.

TcpServerChannel(Int32)

Initializes a new instance of the TcpServerChannel class that listens on the specified port.

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)

Parameters

port
Int32

The port on which the channel listens.

Examples

The following code example shows the use of this constructor.

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

Remarks

To request that an available port be dynamically assigned, set the port parameter to 0 (zero).

Applies to

TcpServerChannel(IDictionary, IServerChannelSinkProvider)

Initializes a new instance of the TcpServerChannel class with the specified channel properties and sink.

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)

Parameters

properties
IDictionary

A IDictionary collection specifying values for configuration properties to be used by the channel.

sinkProvider
IServerChannelSinkProvider

The IServerChannelSinkProvider implementation to be used by the channel.

Exceptions

A provided channel property was badly formatted.

Examples

The following code example shows the use of this constructor to create a TcpServerChannel object with specific configuration properties.

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

Remarks

For more information about channel configuration properties, see Channel and Formatter Configuration Properties.

Note

If you do not require sink functionality, set the sinkProvider parameter to null.

See also

Applies to

TcpServerChannel(String, Int32)

Initializes a new instance of the TcpServerChannel class with the given name and that listens on the specified port.

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)

Parameters

name
String

The name of the channel.

port
Int32

The port on which the channel listens.

Examples

The following code example shows how to construct a TcpServerChannel.

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

Remarks

This constructor sets the ChannelName property by using the name parameter. If you want to register more than one channel, each channel must have a unique name.

To request that an available port be dynamically assigned, set the port parameter to 0 (zero).

Applies to

TcpServerChannel(IDictionary, IServerChannelSinkProvider, IAuthorizeRemotingConnection)

Initializes a new instance of the TcpServerChannel class with the specified channel properties, sink, and authorization provider.

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)

Parameters

properties
IDictionary

A IDictionary collection that specifies values for configuration properties to be used by the channel.

sinkProvider
IServerChannelSinkProvider

The IServerChannelSinkProvider implementation to be used by the channel.

authorizeCallback
IAuthorizeRemotingConnection

The IAuthorizeRemotingConnection implementation to be used by the channel.

Exceptions

A provided channel property was badly formatted.

Remarks

For more information about channel configuration properties, see Channel and Formatter Configuration Properties.

See also

Applies to

TcpServerChannel(String, Int32, IServerChannelSinkProvider)

Initializes a new instance of the TcpServerChannel class with the given name, which listens on the specified port, and uses the specified sink.

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)

Parameters

name
String

The name of the channel.

port
Int32

The port on which the channel listens.

sinkProvider
IServerChannelSinkProvider

The IServerChannelSinkProvider implementation to be used by the channel.

Examples

The following code example shows how to construct a 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);

Remarks

This constructor sets the ChannelName property by using the name parameter. If you want to register more than one channel, each channel must have a unique name.

To request that an available port be dynamically assigned, set the port parameter to 0 (zero).

If you do not require sink functionality, set the sinkProvider parameter to null.

Applies to