Export (0) Print
Expand All

TcpServerChannel Constructor (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.

Namespace:  System.Runtime.Remoting.Channels.Tcp
Assembly:  System.Runtime.Remoting (in System.Runtime.Remoting.dll)

public TcpServerChannel(
	string name,
	int port,
	IServerChannelSinkProvider sinkProvider
)

Parameters

name
Type: System.String

The name of the channel.

port
Type: System.Int32

The port on which the channel listens.

sinkProvider
Type: System.Runtime.Remoting.Channels.IServerChannelSinkProvider

The IServerChannelSinkProvider implementation to be used by the channel.

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.

The following code example shows how to construct a TcpServerChannel.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft