lan cable disconnect detection

hello there..

m working with an appl which is supposed to detect the lan cable presence. on removal of the cable it shows an error msg. m presently doing this by catching a socket exeption, n the msg goes in the catch block.

the problem m facing is the time taken for this operation.if the cable is removed n re-attached quickly the exception is not thrown..

is there any other way to do this?

how does windows do it that fast? what is the dll it calls?

guys... hoping for a good soln,hve burnt my head over this...

thanx in advance....

[582 byte] By [sharath2a] at [2007-10-2 10:56:33]
# 1
Hi,You can only detect a lost connection by trying to write to the connection, so you should implement some kind of heart beat functionallity.Kaj
kajbja at 2007-7-13 3:21:44 > top of Java-index,Java Essentials,Java Programming...
# 2
Hi Kaj.. thanx for that quick reply.. but isnt there a way i could use JNI n access the same method windows is trying to call for this detection? will that work?
sharath2a at 2007-7-13 3:21:44 > top of Java-index,Java Essentials,Java Programming...
# 3

> Hi Kaj..

> thanx for that quick reply.. but isnt

> ply.. but isnt there a way i could use JNI n access

> the same method windows is trying to call for this

> detection? will that work?

I guess you would be able to do what Windows does, but I don't know how windows detects that the cable is unplugged. There is no way to detect it in TCP/IP without heartbeats.

Kaj

kajbja at 2007-7-13 3:21:44 > top of Java-index,Java Essentials,Java Programming...
# 4
This article from the knowledge base might be a starting point on what to look for. http://support.microsoft.com/kb/q239924/But the question is no longer a java question.Kaj
kajbja at 2007-7-13 3:21:44 > top of Java-index,Java Essentials,Java Programming...