473,799 Members | 3,197 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TcpChannel Connection Timeout Value While Remoting


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
make another call from client side.

Only after 2.3 minutes, on client side a System.Net socket exception is
thrown and server side is unaware
about that conneciton is broken !!.

Can anybody help me with the way of minimizing this timeout value or making
both client and server
side aware of that connection is broken in a short time ?

Helps'll be appreciated..

Ahmet
Nov 15 '05 #1
1 9596
Ahmet

I don't think you can set a timeout on a tcp connection from .NET remoting.
I tried to find a solution, the only timeout you can set is on a channel
sink of a http channel.
You have some alternatives.
1.You can use async invoke of remoting functions using delegates
2.You can use a timer from System.Threadin g namespace, start the timer when
the function start (the timer will run in separate thread) and on timer
event to try invoke again from example

Here is a code that shows how to use async invoke:
//this is a delegate with the same signature with the function to invoke

public delegate Stream GetRestoreStrea mDelegate(Authe nticationInfo
info,String backupName,
String folderName,Stri ng fileName,ItemIn fo files);

//this is the code that performes the invoke

srv=(RemotingSe rver)Activator. GetObject(typeo f(RemotingServe r),Settings.Ser v
erName);

GetRestoreStrea mDelegate d;
d=new GetRestoreStrea mDelegate(srv.G etRestoreStream );

AsyncCallback cb;
cb=new AsyncCallback(G etRestoreStream Result);

Object state;
state=new Object();

IAsyncResult ar;

ar=d.BeginInvok e(info,strCateg ory,folderName, strFileName,(It emInfo)tvwFiles .
Tag,null,null);

//the function WaitOne will finished either if a result is received either
if a timeout is reached
ar.AsyncWaitHan dle.WaitOne(180 0000,false);

//this is the callback function that receives the result of call

public void GetRestoreStrea mResult(IAsyncR esult ar)
{
GetRestoreStrea mDelegate d;
d=(GetRestoreSt reamDelegate)(( AsyncResult)ar) .AsyncDelegate;
d.EndInvoke(ar) ;
}

Hope this helps
Dan Cimpoiesu

"Ahmet AKGUN" <ak*********@ho tmail.com> wrote in message
news:e3******** ******@TK2MSFTN GP10.phx.gbl...

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
make another call from client side.

Only after 2.3 minutes, on client side a System.Net socket exception is
thrown and server side is unaware
about that conneciton is broken !!.

Can anybody help me with the way of minimizing this timeout value or making both client and server
side aware of that connection is broken in a short time ?

Helps'll be appreciated..

Ahmet

Nov 15 '05 #2

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

Similar topics

2
3943
by: Dicky Cheng | last post by:
Hi, I am using .net remoting technology. I set up a .net remoting client and server in IIS. When the client calls the server, the server will run a long duration method (30-60seconds). I have a test on it that if the network broken at the time the client have already send the remoting request and waiting for the server, the client side will wait infinitely by default, even if i already set the executionTimeout to 90seconds in...
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.
7
2944
by: mfeingold | last post by:
I am working on a system, which among other things includes a server and a ..net control sitting in an html page and connected to the server. I ran into a couple of problems, you guys might have some insight about. 1) It takes 20 sec or so to open a tcp socket from the client to the server. It just sits in the TcpClient.conect waiting for something. When I run the same control from a windows application it connects right away and works...
0
978
by: Risen | last post by:
Hi,all, How to declare a TCPChannel Object and implement it? In MSDN I found code and try it In IDE,but it have some error,so can not compile it! Imports System Imports System.Runtime.Remoting Imports System.Runtime.Remoting.Channels Imports System.Runtime.Remoting.Channels.TCP -> error! IDE report not found this namespace or type £¿£¿
2
3330
by: Risen | last post by:
Hi,all, How to declare a TCPChannel Object and implement it? In MSDN I found code and try it In IDE,but it have some error,so can not compile it! Imports System Imports System.Runtime.Remoting Imports System.Runtime.Remoting.Channels Imports System.Runtime.Remoting.Channels.TCP -> error! IDE report not found this namespace or type £¿£¿
2
10653
by: Sagaert Johan | last post by:
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 (...
0
3163
by: Douglas Peterson | last post by:
I'm using Remoting to implement a client/server. I recently discovered that I cannot connect a second instance client because it is trying to reuse the port and appearently the socket isn't setup for address reuse. Upon creating the TcpChannel I get the following exception: "An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in system.runtime.remoting.dll Additional information: Only one usage of each socket...
0
2978
by: faculaganymede | last post by:
C# Gurus, I am trying to understand more about TcpChannel and remoting. 1. Do TcpChannel functions wrap around the socket functions (i.e. calls the socket functions internally)? 2. If I have a server app that is set up using socket functions, can I set up a TcpChannel client app to communicate with that server? Would they know how to communicate? Or, do I have to set up the server app using TcpChannel functions also? 3. If I have...
1
10130
by: =?Utf-8?B?S29zbW8=?= | last post by:
Hi, When the remoting server is not available (it is unreachanble/ closed/ non-existent), making a call on the remoted object takes 45 seconds, and this timeout value cannot be changed. MSDN says this problem is fixed by setting the channel timeout property, but this doesn't work. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=892614&SiteID=1
0
10470
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10247
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
10214
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
10023
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...
0
9067
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7561
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
6803
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5583
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.