Ask a Question related to UNIX Programming, Design and Development.
-
anita #1
How can my application detect the physical network problem
I have one application running on solaris and other on windows NT.
These two
communicate thro' sockets.
The application running on solaris is server and the one running on
windows is client.
These two systems are connected through ethernet switch box.
The application on solaris should be able to detect and inform user if
there is some physical connection problem like wire unplugged from
ethernet switch.
I have ping program which sends and receives the icmp packets.
When I tested this program independently, it seemed to work fine, i.e.
when i unplugged the wire, ping returned that "resource temporarily
unavailable"
When I integrated this one with my real application, its not working.
Once the client application connects, i get the host address of client
and after this ping program checks the client periodically. When i
unplug the wire, I expect recvfrom function to return <= 0 but it
always returns number of bytes greater than 0.
Is there any other way my application can detect physical network
problem.
When I unplug the wire, i see that syslogd puts a message "no MII link
detected" in log file. Is it possible for my application to catch this
message.
This would be neat way rather than sending icmp packets all the time.
Any help or suggestion will be appreciated.
Thanks
anita Guest
-
Problem with asp.net application locate on network share
Hi all, I have an asp.net application (framework 1.1 sp1) on windows server 2003. When the document root is locate in local that's all ok... but... -
How to allow my Web Application access a network resource?
All, I have an ASP.NET application (with FormAuthentication but it shouldn't matter because I may allow unauthenticated user also). I want to... -
can't access ASP web application from another PC in same network
Hello, all My asp web application work perfectly at web server machine(localhost), but when I try it from another pc, I can see default.html, but... -
ASPNET Account Security Problem - Running a Web Application over a network share
All, If anyone has been following my trials over the last week see(Setting up a Web Application on IIS 5.1 and ASP.Net Security Problems). I'm... -
Dir MX: (Network) application installer
Hi, I would like to provide the users of the application I am going to develop with a graphic install wizard (installation of drivers, acrobat... -
David Schwartz #2
Re: How can my application detect the physical network problem
"anita" <anita_sc_2000@yahoo.com> wrote in message
news:b0677a2a.0307101804.5077b79f@posting.google.c om...
If recvfrom returns bytes, you must be receiving some data. What are you> When I integrated this one with my real application, its not working.
> Once the client application connects, i get the host address of client
> and after this ping program checks the client periodically. When i
> unplug the wire, I expect recvfrom function to return <= 0 but it
> always returns number of bytes greater than 0.
receiving and where are you receiving it from? (Look at what you got.)
Loss of MII link doesn't measure what you want to measure. You want to> Is there any other way my application can detect physical network
> problem.
> When I unplug the wire, i see that syslogd puts a message "no MII link
> detected" in log file. Is it possible for my application to catch this
> message.
> This would be neat way rather than sending icmp packets all the time.
> Any help or suggestion will be appreciated.
measure, I presume, whether host A still has a network link to host B,
regardless of what's inbetween them.
DS
David Schwartz Guest
-
anita #3
Re: How can my application detect the physical network problem
"David Schwartz" <davids@webmaster.com> wrote in message news:<bel9ff$qf1$1@nntp.webmaster.com>...
Thanks for the reply.> "anita" <anita_sc_2000@yahoo.com> wrote in message
> news:b0677a2a.0307101804.5077b79f@posting.google.c om...
>>> > When I integrated this one with my real application, its not working.
> > Once the client application connects, i get the host address of client
> > and after this ping program checks the client periodically. When i
> > unplug the wire, I expect recvfrom function to return <= 0 but it
> > always returns number of bytes greater than 0.
> If recvfrom returns bytes, you must be receiving some data. What are you
> receiving and where are you receiving it from? (Look at what you got.)
>>> > Is there any other way my application can detect physical network
> > problem.
> > When I unplug the wire, i see that syslogd puts a message "no MII link
> > detected" in log file. Is it possible for my application to catch this
> > message.
> > This would be neat way rather than sending icmp packets all the time.
> > Any help or suggestion will be appreciated.
> Loss of MII link doesn't measure what you want to measure. You want to
> measure, I presume, whether host A still has a network link to host B,
> regardless of what's inbetween them.
>
> DS
The recvfrom() is reading the left out data on recv buffer and than it
hangs.
I have set the timeout for recv and have made socket non blocking.
Its the same scenario when using tcp socket for communication, When I
unplug, read() function takes some time to read the remaining data in
the recv buffer, after it has read all that, the application is hung
untill I plug back when it again starts getting data.
Again I have set the timeout for recv to be 1 sec and also have made
socket non blocking. Why is it still getting hung.
Yes I want to find out if host A still has network with host B, is
there any interrupt or some mechanism by which my application can find
out if something wrong with network
anita Guest
-
anita #4
Re: How can my application detect the physical network problem
"David Schwartz" <davids@webmaster.com> wrote in message news:<bel9ff$qf1$1@nntp.webmaster.com>...
Looks like for some reason when i posted reply before its was not successful, so> "anita" <anita_sc_2000@yahoo.com> wrote in message
> news:b0677a2a.0307101804.5077b79f@posting.google.c om...
>>> > When I integrated this one with my real application, its not working.
> > Once the client application connects, i get the host address of client
> > and after this ping program checks the client periodically. When i
> > unplug the wire, I expect recvfrom function to return <= 0 but it
> > always returns number of bytes greater than 0.
> If recvfrom returns bytes, you must be receiving some data. What are you
> receiving and where are you receiving it from? (Look at what you got.)
>>> > Is there any other way my application can detect physical network
> > problem.
> > When I unplug the wire, i see that syslogd puts a message "no MII link
> > detected" in log file. Is it possible for my application to catch this
> > message.
> > This would be neat way rather than sending icmp packets all the time.
> > Any help or suggestion will be appreciated.
> Loss of MII link doesn't measure what you want to measure. You want to
> measure, I presume, whether host A still has a network link to host B,
> regardless of what's inbetween them.
>
> DS
trying again
Thanks for the reply.
The recvfrom() is reading the left out data on recv buffer and than it
hangs.
I have set the timeout for recv and have made socket non blocking.
Its the same scenario when using tcp socket for communication, When I
unplug, read() function takes some time to read the remaining data in
the recv buffer, after it has read all that, the application is hung
untill I plug back when it again starts getting data.
Again I have set the timeout for recv to be 1 sec and also have made
socket non blocking. Why is it still getting hung.
Yes I want to find out if host A still has network with host B, is
there any interrupt or some mechanism by which my application can find
out if something wrong with network
anita Guest
-
David Schwartz #5
Re: How can my application detect the physical network problem
"anita" <anita_sc_2000@yahoo.com> wrote in message
news:b0677a2a.0307111002.2433b3b4@posting.google.c om...
You have made the socket non-blocking and recvfrom still blocks? That> The recvfrom() is reading the left out data on recv buffer and than it
> hangs.
> I have set the timeout for recv and have made socket non blocking.
pretty much has to be a bug in your code.
You are seeing a 'read' to a non-blocking socket not return immediately?> Its the same scenario when using tcp socket for communication, When I
> unplug, read() function takes some time to read the remaining data in
> the recv buffer, after it has read all that, the application is hung
> untill I plug back when it again starts getting data.
> Again I have set the timeout for recv to be 1 sec and also have made
> socket non blocking. Why is it still getting hung.
That should be impossible.
No, there isn't. The only way you can tell is by sending data that> Yes I want to find out if host A still has network with host B, is
> there any interrupt or some mechanism by which my application can find
> out if something wrong with network
requires a reply and not getting a reply.
DS
David Schwartz Guest
-
Barry Margolin #6
Re: How can my application detect the physical network problem
In article <Pine.GSO.4.44.0307111440420.8703-100000@unix.cs.tamu.edu>,
Siddharth Choudhuri <choudhri@cs.tamu.edu> wrote:Note that this technique will only work if the client sends something every>>> The recvfrom() is reading the left out data on recv buffer and than it
>> hangs.
>> I have set the timeout for recv and have made socket non blocking.
>> Its the same scenario when using tcp socket for communication, When I
>> unplug, read() function takes some time to read the remaining data in
>> the recv buffer, after it has read all that, the application is hung
>> untill I plug back when it again starts getting data.
>try select() with a timeout on the socket-fd that was opened with host B.
second. Otherwise, you can't tell the difference between a network failure
and the client simply not having anything to send.
If you need to detect network failure, the application protocol has to
include a "heartbeat", where the systems send something over the connection
periodically, even if they have no real data to send (like the TV
commercial where the guy keeps saying "Can you hear me now?").
--
Barry Margolin, [email]barry.margolin@level3.com[/email]
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
Barry Margolin Guest
-
Alan Coopersmith #7
Re: How can my application detect the physical network problem
[email]anita_sc_2000@yahoo.com[/email] (anita) writes in comp.unix.programmer:
|I have one application running on solaris and other on windows NT.
|These two
|communicate thro' sockets.
|The application running on solaris is server and the one running on
|windows is client.
|These two systems are connected through ethernet switch box.
|
|The application on solaris should be able to detect and inform user if
|there is some physical connection problem like wire unplugged from
|ethernet switch.
The machine can detect when the cable from it to the next device (in
your case the switch) is not getting any signal, but not any network
problem beyond that - it won't know if the switch is connected to any
other device, including routers, other computers, other switches, etc.
--
__________________________________________________ ______________________
Alan Coopersmith [email]alanc@alum.calberkeley.org[/email]
[url]http://www.CSUA.Berkeley.EDU/~alanc/[/url] aka: [email]Alan.Coopersmith@Sun.COM[/email]
Working for, but definitely not speaking for, Sun Microsystems, Inc.
Alan Coopersmith Guest



Reply With Quote

