473,890 Members | 5,841 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 9606
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
3953
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
3051
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
2952
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
981
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
3333
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
10672
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
3167
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
2984
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
10135
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
9979
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9823
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,...
1
10924
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
10463
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
8017
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
7170
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
5854
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...
2
4275
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3281
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.