TcpChannel

The TcpChannel class uses a binary formatter to serialize all messages to a binary stream and transport the stream to the target Uniform Resource Identifier (URI) using the TCP protocol. The TcpChannel performs the following functions:

  • Provides communication between sender and receiver using TCP sockets.
  • Provides encoding of payloads in binary format and the industry standard SOAP serialization format.
  • Generates and consumes ChannelDataStore for object references.

The TcpChannel opens and caches as many connections as there are threads making requests to another server at that moment. Socket connections are closed on the client after 15-20 seconds of inactivity.

If you are building a number of applications that use .NET remoting, it can be easy to mistakenly use an HttpChannel object to connect to a server application domain that listens with a TcpChannel. If you do this, the client will receive the following exception: "The underlying connection was closed: An unexpected error occurred on a receive." If you have a client that receives this exception, you should check the client and the server for mismatched channels.

See Also

Channels | HttpChannel | HttpChannel Class