Hi,
I am working on a project where some PCs are sending messages via Tcp
sockets.
When the Tcp connection is down (cable unplugged) I detect it using WMI.
When the connection is back, it does not mean that I can immediately send
data.
My question is : is there any event that I can trigger when I can send data
again ?
If no, what is the best way to handle this (retries, ...) ?
Thanks in advance,
Droopy. 5 2992
Hi, When the Tcp connection is down (cable unplugged) I detect it using WMI.
You dont need that really, just check if you can connect or not, a
connection may be down because a lot more thing beside you disconnect your
cable, what if it's the router where the cable is disconnecteD?
When the connection is back, it does not mean that I can immediately send data.
Well, first you need to restablish the connection, the other ends need to be
aware of it too, in a similar way the other end should check for connection
errors
If no, what is the best way to handle this (retries, ...) ?
Yes, retries is the best (if not the only) solution here
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Ignacio Machin \( .NET/ C# MVP \)" <ignacio.machin AT dot.state.fl.us>
wrote in news:#m**************@TK2MSFTNGP11.phx.gbl: Hi, When the Tcp connection is down (cable unplugged) I detect it using WMI. You dont need that really, just check if you can connect or not, a connection may be down because a lot more thing beside you disconnect your cable, what if it's the router where the cable is disconnecteD?
True, I want to handle all communication errors When the connection is back, it does not mean that I can immediately send data.
Well, first you need to restablish the connection, the other ends need to be aware of it too, in a similar way the other end should check for connection errors
The problem is that the other ends does not see there is a problem, at
least before a timeout elapsed, if it does not send data. If no, what is the best way to handle this (retries, ...) ? Yes, retries is the best (if not the only) solution here
OK I will try this way.
It does not seems trivial at first look ! cheers,
Thanks a lot for your help.
Droopy <dr**************@hotmail.com> wrote in
news:Xn**********************************@195.129. 110.71: "Ignacio Machin \( .NET/ C# MVP \)" <ignacio.machin AT dot.state.fl.us> wrote in news:#m**************@TK2MSFTNGP11.phx.gbl:
Hi, When the Tcp connection is down (cable unplugged) I detect it using WMI.
You dont need that really, just check if you can connect or not, a connection may be down because a lot more thing beside you disconnect your cable, what if it's the router where the cable is disconnecteD?
True, I want to handle all communication errors
When the connection is back, it does not mean that I can immediately send data.
Well, first you need to restablish the connection, the other ends need to be aware of it too, in a similar way the other end should check for connection errors
The problem is that the other ends does not see there is a problem, at least before a timeout elapsed, if it does not send data.
I need a "keep alive" system.
I know Tcp has it but the default is 2 hours.
I am displaying the status of the connection and I would like to be
notified within a few seconds when the connection is down.
Should I do it by myself (sending a kind of ping message) or can I set
the Tcp keep alive value to a few seconds ?
Thanks in advance for any help. If no, what is the best way to handle this (retries, ...) ?
Yes, retries is the best (if not the only) solution here
OK I will try this way. It does not seems trivial at first look !
cheers,
Thanks a lot for your help. http://tangentsoft.net/wskfaq/newbie.html#abnormalclose
See 2.12 and 2.13
--
William Stacey [MVP]
"Droopy" <dr**************@hotmail.com> wrote in message
news:Xn**********************************@195.129. 110.71... Droopy <dr**************@hotmail.com> wrote in news:Xn**********************************@195.129. 110.71:
"Ignacio Machin \( .NET/ C# MVP \)" <ignacio.machin AT dot.state.fl.us> wrote in news:#m**************@TK2MSFTNGP11.phx.gbl:
Hi, When the Tcp connection is down (cable unplugged) I detect it using WMI.
You dont need that really, just check if you can connect or not, a connection may be down because a lot more thing beside you disconnect your cable, what if it's the router where the cable is disconnecteD?
True, I want to handle all communication errors
When the connection is back, it does not mean that I can immediately send data.
Well, first you need to restablish the connection, the other ends need to be aware of it too, in a similar way the other end should check for connection errors
The problem is that the other ends does not see there is a problem, at least before a timeout elapsed, if it does not send data.
I need a "keep alive" system. I know Tcp has it but the default is 2 hours. I am displaying the status of the connection and I would like to be notified within a few seconds when the connection is down. Should I do it by myself (sending a kind of ping message) or can I set the Tcp keep alive value to a few seconds ?
Thanks in advance for any help.
If no, what is the best way to handle this (retries, ...) ?
Yes, retries is the best (if not the only) solution here
OK I will try this way. It does not seems trivial at first look !
cheers,
Thanks a lot for your help.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: comp.lang.php |
last post by:
I'm having a serious problem in my application I simply cannot seem to
fix, and it has to do with multiple inheritances whereby something is
lost.
Class EditView is a child of PagOptionsView...
|
by: Jay O'Connor |
last post by:
I'm using Python 2.3 on windows and trying to use the win32 libs. I
keep getting the following error
>>> import win32gui
Traceback (most recent call last):
File "<pyshell#6>", line 1, in...
|
by: Storm |
last post by:
.... that I would like to use in a client/server application that would
:
1) detect reliably when connection is lost and try automatically to
reconnect to the server and the link is declared...
|
by: Damjan |
last post by:
Does MySQLdb automatically reconnect if the connection to the database is
broken?
I'm asking this since I have a longrunning Python precess that is connected
to Mysql-4.1.11, and I execute "set...
|
by: Josh Schmidt |
last post by:
How can one set the terminal services profile and home
directory path in AD using VB.NET? I can set the usual
profile paths, but terminal services properties are not
supported with ADSI.
Any...
|
by: Emanuele |
last post by:
I have write a program using MS Visual studio C++ 7.0 (platform Windows XP professional). I'm not using .NET.
This program save data in a SQL server 2000 database using ADO.
Everything works...
|
by: =?Utf-8?B?QWxwZXIgQUtDQVlPWg==?= |
last post by:
Hello,
First of all I wish you a good day.
My help request is about .NET asynchrounus socket communication. I have
developed Server-Client Windows Forms .NET applications in VC++ .NET v2003. I...
|
by: sreejithp |
last post by:
Hello,
I am new to python. I have been trying to connect to telnet and feed some data from a server. Its working properly. I used the connectionObj.read_until() method to read the data from the...
|
by: n8kindt |
last post by:
hi guys, i am also posting this question in the MySQL forum but am putting the detailed post on here. here is the message i am having problems with:
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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: 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...
| |