Getting started: sample .NET client-server application with SmartChannels.
|
Getting started: sample .NET client-server application with SmartChannels. - Defining server configuration |
|
|
|
|
Page 3 of 5
Defining server configuration.
- Add app.config file to the MyServer project:
- Modify it adding this piece of text to it:
<system.runtime.remoting>
<application>
<service>
<wellknown mode="SingleCall" type="MyServer.MyServer, MyServer" objectUri="MyServer.rem"/>
</service>
<channels>
<channel port="5000" ref="tcp">
<serverProviders>
<provider type="SSB.Runtime.Remoting.TosChannelSinkProvider, SmartChannels" />
<formatter ref="binary" />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
This will tell to .NET Remoring infrastructure to startup the service with address tcp://localhost:5000/MyServer.rem and use binary formatter for requests with TosChannelSinkProvider embeeded into the communication channel . TosChannelSinkProvider is part of SmartChannels library and is responsible for communication with clients, copable to detect network timeouts and disconnections. We will see how to setup client’s network configuration later. That’s it with the server. To the moment you should be able to compile and run MyServer.exe
|