Home SmartChannels Getting started: sample .NET client-server application with SmartChannels. - Defining client configuration

Login Form



Getting started: sample .NET client-server application with SmartChannels.
Getting started: sample .NET client-server application with SmartChannels. - Defining client configuration PDF Print E-mail
Article Index
Getting started: sample .NET client-server application with SmartChannels.
Server implementation
Defining server configuration
Client implementation
Defining client configuration

Defining client configuration.

  • Add app.config file to the MyClient project (the same way you did for MyServer)
  • Modify it adding this piece of text to it:

<system.runtime.remoting>
    <application>
      <channels>
        <channel ref="tcp">
          <clientProviders>
            <formatter ref="binary"/>
            <provider type="SSB.Runtime.Remoting.TocChannelSinkProvider, SmartChannels"  defaultPollingInterval="30" defaultTimeoutInterval="10" >
            </provider>
          </clientProviders>
        </channel>
      </channels>
    </application>
 </system.runtime.remoting>



This will tell to .NET Remoring infrastructure to use binary formatter for requests with TocChannelSinkProvider (client counterpart of TosChannelSinkProvider) embeeded into communication channel .

TocChannelSinkProvider is part of SmartChannels library and is responsible for communication with servers, copable to support network timeouts and disconnections detection.

Here we also supply 2 parameters for TocChannelSinkProvider: defaultPollingInterval and defaultTimeoutInterval.

defaultPollingInterval is a default (valid for all destinations for which pollingInterval is not set explicitely) amount of time in seconds which determines how often client will send system requests to the server in order to detect network failures, client or server disconnections and network timeouts.

defaultTimeoutInterval is a default (valid for all destinations for which timeoutInterval is not set explicitely) amount of time in seconds wich determines how long client will wait the response on service request from the server before treating network connection as timed out.

That’s it with the client. To the moment you should be able to compile and run MyClient.exe

Now, if run MyServer and MyClient, you will be able to type messages in MyClient window and see them appearing in MyServer window.

Congratulations. You have created simple client-server application using .NET Remoting and SmartChannels.

In case you will have any questions please contact us: This e-mail address is being protected from spambots. You need JavaScript enabled to view it


 

Copyright © 2010 SmartSoftwareBits.com. All Rights Reserved.