473,385 Members | 1,587 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Remoting Problem

I have a simple remote server object that raises an event when the list
maintined by it changes. The idea is to enable the remote client to
update the GUI when the server list changes. When the I create the
server object without using remoting (i.e. just use new()) the event
fires and the client updates the UI but when I create the server object
as a remote object (using Activator.GetObject()) the event does not
fire at all. I have pasted the code below. I am pulling my hair out
trying to solve this simple problem. Any help will be much appreciated.
Thank you.

================================================== =
Source Code from Remoting Host ( Console App)
================================================== =

// Configure the Remoting Infrastructure
BinaryServerFormatterSinkProvider provider = new
BinaryServerFormatterSinkProvider();
provider.TypeFilterLevel =
System.Runtime.Serialization.Formatters.TypeFilter Level.Full;
Hashtable props = new Hashtable();
props["port"] = Facade.RemotingParameters.PORT;

// Register Channel first
System.Runtime.Remoting.Channels.Tcp.TcpServerChan nel channel = new
System.Runtime.Remoting.Channels.Tcp.TcpServerChan nel(props,provider);
System.Runtime.Remoting.Channels.ChannelServices.R egisterChannel(channel,false);

// Use Server Activated and Singleton as the object mode
System.Type remoteType = typeof(BusinessLayer.Services);
RemotingConfiguration.RegisterWellKnownServiceType (remoteType ,
Facade.RemotingParameters.URI,
WellKnownObjectMode.Singleton);

================================================== =
Source Code from Remoting Client (System.Windows.Forms App)
================================================== =

// Register a Channel for Event Handler purposes.
ChannelServices.RegisterChannel(new TcpClientChannel(), false);

// Create the remote object
this._services =
(Facade.IServices)Activator.GetObject(typeof(Facad e.IServices),
this._txtServer.Text);

// Add Event Handler
this._eventRepeater = new Facade.EventRepeater();
this._eventRepeater.ListChanged += this.ListChangedEventHandler;
this._services.ListChanged += _eventRepeater.ListChangedEventHandler;

Mar 6 '06 #1
3 1492
Is it possible that your Singleton server object is expiring? Have you
looked into the InitializeLifetimeService() method of
MarshalByRefObject?

-Alan

Mar 6 '06 #2
I just pulled up some code I wrote a few years back that did what
you're trying to accomplish. I used a TcpChannel at port 0 on my client
instead of a TcpClientChannel. On my server, I had the
InitializeLifetimeService method overridden as follows:

public override object InitializeLifetimeService()
{
return null;
}

Mar 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere, SourceOffSite, VSS...
5
by: mayamorning123 | last post by:
A comparison among six VSS remote tools including SourceOffSite , SourceAnyWhere, VSS Connect, SourceXT, VSS Remoting, VSS.NET To view the full article, please visit...
0
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool including SourceOffSite, SourceAnyWhere and VSS Remoting This article makes a detailed...
1
by: David Krmpotic | last post by:
Hi All! I have a .NET remoting Client-Server application with Server Activated Objects only.. something is worrying me.. sometimes (rarely), I can't connect to the server although it is...
0
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere, SourceOffSite, VSS...
0
by: Martijn Damen | last post by:
Hi, At the moment I am trying to develop an application that uses another app over .net remoting and having some problems with it (ok, that is ofcourse why I am here), hope somebody can shine a...
5
by: LGHummel | last post by:
I'm trying to host a remoting app in IIS and am getting the following error: Failed to execute the request because the ASP.NET process identity does not have read permissions to the global...
9
by: swartzbill2000 | last post by:
Hello, I am trying to build and run the Remoting Sample from MSDN. Everything compiles. The Listener appears to run. The Client throws this RemotingException: A first chance exception of type...
1
by: Thomee Wright | last post by:
I'm having a problem with a pair of applications I'm developing. I have a server application which interacts with several instruments, and a client app which connects to the server and provides a...
0
by: Kristian Reukauff | last post by:
Hi I have a problem with the .Net-Securty-Functions. I've got a client and a server. When I try to register a channel at the server with this line: ChannelServices.RegisterChannel(chan, false);...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.