|
Advanced scenarios: callbacks and authorization. - Defining service configuration. |
|
|
|
|
Page 5 of 8
Defining service 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="MyService.MyService, MyService" objectUri="MyService.rem"/>
</service>
<channels>
<channel port="5000" ref="tcp">
<serverProviders>
<provider type="SSB.Runtime.Remoting.TosChannelSinkProvider, SmartChannels" />
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
<clientProviders>
<formatter ref="binary"/>
<provider type="SSB.Runtime.Remoting.TocChannelSinkProvider, SmartChannels" defaultPollingInterval="10" defaultTimeoutInterval="5">
</provider>
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
Since our service will act as a server and as a client (to call callbacks), we specified 2 provider types inside one channel - serverProviders and clientProviders. In the example we define the channel that will listen on port 5000 and use tcp transport. Also it will binary formatter for server and client part of the channel. Also, it will use TosChannelSinkProvider to build server role channel and will use TocChannelSinkProvider to form channel for client role. We also published our service type MyService.MyService located in MyService.dll assembly as a SingleCall object under the URI of "MyService.rem". Therefore, our service URL will be: tcp://localhost:5000/MyService.rem
TosChannelSinkProvider and TocChannelSinkProvider is part of SmartChannels library and is responsible to provide reliable communications with ability to detect network timeouts and disconnections.
|