473,786 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remoting TcpChannel Timeout ? ?

Hi

When the remoting server starts and the client immediate begins calling the
remote object on the server no problems.
But when the client does not need to access the remote object for some time
the connection seems to be broken on the next attempt to do a call to the
remote object on the server. (i need to restart the server application to
get it working again ).

So it appears if the remoting connection is idle for some time ( about a
minute max ) the connection seems to break.
When there are regular call it ran for a whole day without problems.

Any way i can fix this ?

Thanks ,
Johan
this is how i ini the remote server
// Register our tcp channel

ChannelServices .RegisterChanne l(new TcpChannel(sett ing.RemotePort) , false);

// Register an object created by the server

rmDisplay = new Display(); //inherits from MarshalByRefObj ect
ObjRef refDisplay = RemotingService s.Marshal(rmDis play, "Display");




May 10 '06 #1
2 10651
Can you pls tell me is it Client Activated or Server Activated object? The
life time of Marshal by reference remote object is maintained by the Lease,
Lease Manager and several Sponsors. Lease defines the life time of the remote
object. You can either give long time duration for the remote object in
InitializeLifeT imeService or you can implement ISponsor Interface in calling
application and then override RenewLease() to solve this problem

"Sagaert Johan" wrote:
Hi

When the remoting server starts and the client immediate begins calling the
remote object on the server no problems.
But when the client does not need to access the remote object for some time
the connection seems to be broken on the next attempt to do a call to the
remote object on the server. (i need to restart the server application to
get it working again ).

So it appears if the remoting connection is idle for some time ( about a
minute max ) the connection seems to break.
When there are regular call it ran for a whole day without problems.

Any way i can fix this ?

Thanks ,
Johan
this is how i ini the remote server
// Register our tcp channel

ChannelServices .RegisterChanne l(new TcpChannel(sett ing.RemotePort) , false);

// Register an object created by the server

rmDisplay = new Display(); //inherits from MarshalByRefObj ect
ObjRef refDisplay = RemotingService s.Marshal(rmDis play, "Display");




May 10 '06 #2
Hi

I included some code snippets for illustration

if i start the server app and wait some time before starting the client then
if fails with an exception on the client program.
(saying i need to turn off customErrors ....? )

If i call the methods on a regular basis then no problems..

/////////////// CODE ON SERVER PART (remote display
/////////////////////////

public partial class Form1 : Form
{
....
private Display rmDisplay;
....
#region init code
public Form1()
{
InitializeCompo nent();

// Register our tcp channel
ChannelServices .RegisterChanne l(new TcpChannel(5005 0), false);

// Register an object created by the server
rmDisplay = new Display();

ObjRef refDisplay = RemotingService s.Marshal(rmDis play,
"Display");

rmDisplay.RtfMe ssagebox = this.rtb_meldin gen; // pass the
richtextbox on the form to the Display class
rmDisplay.Contr olOwner = this; // needed for Control.Invoke

rmDisplay.SetDi splayTiming += new
Display.SetDisp layTimingHandle r(rmDisplay_Set DisplayTiming);
rmDisplay.SetWo rkLoadEvent += new
Display.SetWork LoadHandler(rmD isplay_SetWorkL oadEvent);
rmDisplay.Incom ingEvent += new
Display.Incomin gEventHandler(r mDisplay_Incomi ngEvent);
System.Runtime. Serialization.F ormatters.Binar y.BinaryFormatt er
MyFormatter = new
System.Runtime. Serialization.F ormatters.Binar y.BinaryFormatt er();
MyFormatter.Fil terLevel =
System.Runtime. Serialization.F ormatters.TypeF ilterLevel.Full ;
}

// rest of source cut
....
....
}

// snippet from display class

class Display : MarshalByRefObj ect
{
public RichTextBox RtfMessagebox;
public Control ControlOwner;

public delegate void SetDisplayTimin gHandler(object sender, int
displaylogo_tim eout,int displayoff_time out);
public event SetDisplayTimin gHandler SetDisplayTimin g;

public delegate void SetWorkLoadHand ler(object sender, int
workload);
public event SetWorkLoadHand ler SetWorkLoadEven t;

public delegate void IncomingEventHa ndler(object sender);
public event IncomingEventHa ndler IncomingEvent;

public Display()
{

}

delegate void SetTimesCallbac k(int displaylogo_tim eout, int
displayoff_time out);

// call its own if Control.Invoke is required to avoid cross thread
problems
public void SetTiming(int displaylogo_tim eout,int
displayoff_time out)
{
if (SetDisplayTimi ng != null)
{
if (ControlOwner.I nvokeRequired == false)
SetDisplayTimin g(this, displaylogo_tim eout,
displayoff_time out);
else
{
SetTimesCallbac k d = new SetTimesCallbac k(SetTiming);
ControlOwner.In voke(d, new object[] {
displaylogo_tim eout, displayoff_time out });
}
}
}

//rest of code cut
...
...
}


///////////////////// CODE on CLient app. (app controlling the remote
display)

// this function is used on the remote client to call the method on the
server

private void SetTimeLimits(i nt t_logo,int t_poweroff)
{
TcpClientChanne l displaych2 = new TcpClientChanne l();
ChannelServices .RegisterChanne l(displaych2, false);

Display rDisplay;

rDisplay = (Display)Activa tor.GetObject(t ypeof(Display),
"tcp://192.168.1.3:500 50/Display");

rDisplay.SetTim ing(t_logo, t_poweroff);

ChannelServices .UnregisterChan nel(displaych2) ;
}




"Altaf Al-Amin Najwani" <al**********@g mail.com> wrote in message
news:85******** *************** ***********@mic rosoft.com...
Can you pls tell me is it Client Activated or Server Activated object? The
life time of Marshal by reference remote object is maintained by the Lease, Lease Manager and several Sponsors. Lease defines the life time of the remote object. You can either give long time duration for the remote object in
InitializeLifeT imeService or you can implement ISponsor Interface in calling application and then override RenewLease() to solve this problem

"Sagaert Johan" wrote:
Hi

When the remoting server starts and the client immediate begins calling the remote object on the server no problems.
But when the client does not need to access the remote object for some time the connection seems to be broken on the next attempt to do a call to the remote object on the server. (i need to restart the server application to get it working again ).

So it appears if the remoting connection is idle for some time ( about a
minute max ) the connection seems to break.
When there are regular call it ran for a whole day without problems.

Any way i can fix this ?

Thanks ,
Johan
this is how i ini the remote server
// Register our tcp channel

ChannelServices .RegisterChanne l(new TcpChannel(sett ing.RemotePort) , false);
// Register an object created by the server

rmDisplay = new Display(); //inherits from MarshalByRefObj ect
ObjRef refDisplay = RemotingService s.Marshal(rmDis play, "Display");




May 10 '06 #3

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

Similar topics

2
3049
by: Ahmet AKGUN | last post by:
Hi; I am trying to make a server that handles db connection pool. Clients use TcpChannel to make a call to this server and get one database connection (OleDbConnection) from pool. But when I try to connect to server using TcpChannel, I get this message "Only one usage of each socket address (protocol/network adress /port)" is normally permitted.
1
9595
by: Ahmet AKGUN | last post by:
Hi All; I have one server to which clients are connected to via TcpChannel. I start server on one host and establish a client connection from another host via tcpchannel. On client, using activators, I try to invoke one function on server side using channel After first successfull fucntion invoke, I unplug ethernet cable on server side and
6
2804
by: Catherine Jones | last post by:
Hi all, we need urgent help in a matter. We are trying to pass a COM object from the client to server and are facing some problems in the same. We've our client in C# as well as the Server in C# and we're using remoting for client to server communication.
15
5753
by: Sharon | last post by:
I’m trying to build a generic Publisher-Subscriber that will work over the net, so I’m using the Remoting. I wish that the subscriber user will be notify about the messages sent by the remote publisher, so I used delegate that the user will be able to set on it his own function for that purpuse. The trouble is that this delegate must not be static because there may be many subscribers, and each subscriber may have different...
4
3118
by: Uchiha Jax | last post by:
Hello everyone, I am a plenty silly person who is trying to learn .NET remoting through trial and error (all articles I read are going over my head at the moment (mostly) so I thought i'd give it a go). What I want to do is this: Have a server instance of the program, this server instance will receive communication from client programs (as demonstrated in the AddMessage()
7
9548
by: Sharon | last post by:
Hi, I wrote a remoting object and published it like this: public class RemoteLogger : MarshalByRefObject { // Contain some methods... } public class RemoteManager
9
2102
by: Nak | last post by:
Hi there, I have been messing around with remoting in an attempt to create a "shared application" as mentioned in another thread by that name. I have created a singleton object just like the example in the 101 VB.NET examples. It works great, only 1 instance ever gets created and is shared by each client. I have a few questions though, * Can the singleton contain events? In such a way that when the
4
2265
by: Sharon | last post by:
Hi, I'm using the remoting, and I have a remoting object that has a public event that other processes should register to it. But when the client process is registering to the remote event, it throw the following exception: System.Runtime.Serialization.SerializationException {“Cannot find the assembly Tester, Version=1.0.2164.27180, Culture=neutral, PublicKeyToken=null.”}
0
1578
by: senpark15 | last post by:
Hi EveryBody, I am developing .net remoting application.I have Created server and client application. Server has installed on Two Pc's and cliient have to connect two Pc's and do some functions. Its working Fine on local machine . But when i tried to connect two PC's, its through an remoting exception This is my server code: Dictionary<string, object> props = new Dictionary<string, object>(); props = "Full";
0
9491
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10104
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7510
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4063
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.