Understanding SAO and CAO Activation Methods in .NET Remoting
page 5 of 9
by Abhishek Kumar Singh
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 40436/ 79

SAO Client implementation for both SAO-SingleCall/Singleton

Listing 5: Module1.vb for remote client

Module Module1
    Sub Main()
        Dim oClientService As New ClientService
    End Sub
End Module

Listing 6: ClientService.vb for remote client

Imports System.Data
Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
Imports System.Runtime.Remoting.Channels.Http
Public Class ClientService
    Private m_oTmrSend As System.Threading.Timer
    Private m_oRemote As ILibrary.IServer
    Private oChannel As HttpChannel = Nothing
    Private m_iTimeInterval As Integer
    Private m_Busy As Boolean = False
    Public Sub OnStart()
        oChannel = New HttpChannel(0)
        ChannelServices.RegisterChannel(oChannel, False)
        m_oRemote = Activator.GetObject(GetType(ILibrary.IServer), _
     "http://" & "localhost:1" & "/TestRemoteServer")
        Console.WriteLine(" Remote Client Started at " & Now.ToString())
        Console.WriteLine("CLIENT_A :: Channel Registered :" & _
        Dim timerDelegate As Threading.TimerCallback = AddressOf DoAction
        m_oTmrSend = New System.Threading.Timer(timerDelegate, Me, 0, 10000)
    End Sub
    Public Sub DoAction(ByVal sender As Object)
Console.WriteLine("Received from Server: " & _
     End Sub
    Protected Overrides Sub Finalize()
        Console.WriteLine("CLIENT_A :: Channel Unregistered :: " & Now.ToString())
    End Sub
End Class

View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-06-24 10:36:08 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search