TcpServerChannel Constructor (String, Int32, IServerChannelSinkProvider)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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
Available since 1.1
Return to top
Show: