Network Connectivity

I have an application on my QNX machine that communicates with a windows
machine. I am using SMB. I’d like to have a loop controlled by a timer that
keeps polling the network at regular time intervals to ensure that data is
flowing back and forth.

If there is no network connectivity, I’d like to quit.

Your suggestions are appreciated.

Shashank

I would really appreciate it if someone can give me a hint.

Thank you,
Shashank


“Shashank” <sbalijepalli@precitech.com> wrote in message
news:c8iut1$rp7$1@inn.qnx.com

I have an application on my QNX machine that communicates with a windows
machine. I am using SMB. I’d like to have a loop controlled by a timer
that
keeps polling the network at regular time intervals to ensure that data is
flowing back and forth.

If there is no network connectivity, I’d like to quit.

Your suggestions are appreciated.

Shashank

Not really sure what you want. Are you looking for code examples?
are you wondering what functions to use? If you could clarify what
you are looking for then perhaps more people can provide input. If
you are looking for feedback on your prototype, then “it looks
ok to me” :slight_smile:

Best regards,

Erick

Shashank <sbalijepalli@precitech.com> wrote:

I would really appreciate it if someone can give me a hint.

Thank you,
Shashank



“Shashank” <> sbalijepalli@precitech.com> > wrote in message
news:c8iut1$rp7$> 1@inn.qnx.com> …

I have an application on my QNX machine that communicates with a windows
machine. I am using SMB. I’d like to have a loop controlled by a timer
that
keeps polling the network at regular time intervals to ensure that data is
flowing back and forth.

If there is no network connectivity, I’d like to quit.

Your suggestions are appreciated.

Shashank
\

Erick Muis
Hardware Group
QNX Software Systems Ltd.
Email: emuis at qnx.com

I wanted to know if there are any Watcom C function/functions I could use to
test the network connection.

Thanks,
Shashank

“Erick Muis” <emuis@node55.ott.qnx.com> wrote in message
news:c8ktr1$f74$1@inn.qnx.com

Not really sure what you want. Are you looking for code examples?
are you wondering what functions to use? If you could clarify what
you are looking for then perhaps more people can provide input. If
you are looking for feedback on your prototype, then “it looks
ok to me” > :slight_smile:

Best regards,

Erick

Shashank <> sbalijepalli@precitech.com> > wrote:

I would really appreciate it if someone can give me a hint.

Thank you,
Shashank


“Shashank” <> sbalijepalli@precitech.com> > wrote in message
news:c8iut1$rp7$> 1@inn.qnx.com> …

I have an application on my QNX machine that communicates with a
windows
machine. I am using SMB. I’d like to have a loop controlled by a timer
that
keeps polling the network at regular time intervals to ensure that data
is
flowing back and forth.

If there is no network connectivity, I’d like to quit.

Your suggestions are appreciated.

Shashank





\


Erick Muis
Hardware Group
QNX Software Systems Ltd.
Email: emuis at qnx.com

I’ll try to be more specific about my question.

I have a qnx and windows machine that are communicating with each other
using SMBFsys.
The IP address of my QNX computer is “192.168.1.99”
and the IP address of my Windows computer is “192.168.1.125”.

If i invoke the foll. command from a QNX shell “ping 192.168.1.125”, I can
determine whether the 2 machines are talking to each other or not.

Is there a way to determine their connectivity from my QNX application?

I will appreciate your help.

Shashank



“Shashank” <sbalijepalli@precitech.com> wrote in message
news:c8la22$opj$1@inn.qnx.com

I wanted to know if there are any Watcom C function/functions I could use
to
test the network connection.

Thanks,
Shashank

“Erick Muis” <> emuis@node55.ott.qnx.com> > wrote in message
news:c8ktr1$f74$> 1@inn.qnx.com> …
Not really sure what you want. Are you looking for code examples?
are you wondering what functions to use? If you could clarify what
you are looking for then perhaps more people can provide input. If
you are looking for feedback on your prototype, then “it looks
ok to me” > :slight_smile:

Best regards,

Erick

Shashank <> sbalijepalli@precitech.com> > wrote:

I would really appreciate it if someone can give me a hint.

Thank you,
Shashank


“Shashank” <> sbalijepalli@precitech.com> > wrote in message
news:c8iut1$rp7$> 1@inn.qnx.com> …

I have an application on my QNX machine that communicates with a
windows
machine. I am using SMB. I’d like to have a loop controlled by a
timer
that
keeps polling the network at regular time intervals to ensure that
data
is
flowing back and forth.

If there is no network connectivity, I’d like to quit.

Your suggestions are appreciated.

Shashank





\


Erick Muis
Hardware Group
QNX Software Systems Ltd.
Email: emuis at qnx.com

You could do a simple getpeername and see if the other socket is connected,
if it returns with a name you can assume it is connected, if it is not it will
return ENOTCONN (not connected).

Just a quick suggestion.

Best regards,

Erick

Shashank <sbalijepalli@precitech.com> wrote:

I’ll try to be more specific about my question.

I have a qnx and windows machine that are communicating with each other
using SMBFsys.
The IP address of my QNX computer is “192.168.1.99”
and the IP address of my Windows computer is “192.168.1.125”.

If i invoke the foll. command from a QNX shell “ping 192.168.1.125”, I can
determine whether the 2 machines are talking to each other or not.

Is there a way to determine their connectivity from my QNX application?

I will appreciate your help.

Shashank



“Shashank” <> sbalijepalli@precitech.com> > wrote in message
news:c8la22$opj$> 1@inn.qnx.com> …
I wanted to know if there are any Watcom C function/functions I could use
to
test the network connection.

Thanks,
Shashank

“Erick Muis” <> emuis@node55.ott.qnx.com> > wrote in message
news:c8ktr1$f74$> 1@inn.qnx.com> …
Not really sure what you want. Are you looking for code examples?
are you wondering what functions to use? If you could clarify what
you are looking for then perhaps more people can provide input. If
you are looking for feedback on your prototype, then “it looks
ok to me” > :slight_smile:

Best regards,

Erick

Shashank <> sbalijepalli@precitech.com> > wrote:

I would really appreciate it if someone can give me a hint.

Thank you,
Shashank


“Shashank” <> sbalijepalli@precitech.com> > wrote in message
news:c8iut1$rp7$> 1@inn.qnx.com> …

I have an application on my QNX machine that communicates with a
windows
machine. I am using SMB. I’d like to have a loop controlled by a
timer
that
keeps polling the network at regular time intervals to ensure that
data
is
flowing back and forth.

If there is no network connectivity, I’d like to quit.

Your suggestions are appreciated.

Shashank





\


Erick Muis
Hardware Group
QNX Software Systems Ltd.
Email: emuis at qnx.com

Erick Muis
Hardware Group
QNX Software Systems Ltd.
Email: emuis at qnx.com

Thank you,

I guess its a stupid question. But, how can i get the socket number for the
windows machine?

Shashank


“Erick Muis” <emuis@node55.ott.qnx.com> wrote in message
news:c9013e$8f4$1@inn.qnx.com

You could do a simple getpeername and see if the other socket is
connected,
if it returns with a name you can assume it is connected, if it is not it
will
return ENOTCONN (not connected).

Just a quick suggestion.

Best regards,

Erick

Shashank <> sbalijepalli@precitech.com> > wrote:
I’ll try to be more specific about my question.

I have a qnx and windows machine that are communicating with each other
using SMBFsys.
The IP address of my QNX computer is “192.168.1.99”
and the IP address of my Windows computer is “192.168.1.125”.

If i invoke the foll. command from a QNX shell “ping 192.168.1.125”, I
can
determine whether the 2 machines are talking to each other or not.

Is there a way to determine their connectivity from my QNX application?

I will appreciate your help.

Shashank



“Shashank” <> sbalijepalli@precitech.com> > wrote in message
news:c8la22$opj$> 1@inn.qnx.com> …
I wanted to know if there are any Watcom C function/functions I could
use
to
test the network connection.

Thanks,
Shashank

“Erick Muis” <> emuis@node55.ott.qnx.com> > wrote in message
news:c8ktr1$f74$> 1@inn.qnx.com> …
Not really sure what you want. Are you looking for code examples?
are you wondering what functions to use? If you could clarify what
you are looking for then perhaps more people can provide input. If
you are looking for feedback on your prototype, then “it looks
ok to me” > :slight_smile:

Best regards,

Erick

Shashank <> sbalijepalli@precitech.com> > wrote:

I would really appreciate it if someone can give me a hint.

Thank you,
Shashank


“Shashank” <> sbalijepalli@precitech.com> > wrote in message
news:c8iut1$rp7$> 1@inn.qnx.com> …

I have an application on my QNX machine that communicates with a
windows
machine. I am using SMB. I’d like to have a loop controlled by a
timer
that
keeps polling the network at regular time intervals to ensure that
data
is
flowing back and forth.

If there is no network connectivity, I’d like to quit.

Your suggestions are appreciated.

Shashank





\


Erick Muis
Hardware Group
QNX Software Systems Ltd.
Email: emuis at qnx.com





\


Erick Muis
Hardware Group
QNX Software Systems Ltd.
Email: emuis at qnx.com

I forgot to mention.

I am using user_smb()
and mount_smb()

to mount a windows directory onto my qnx machine.

What i want to be able to do is “detect for any network disconnectivity
between the machines” and unmount the path and exit if such a condition
occurs.

Shashank


“Shashank” <sbalijepalli@precitech.com> wrote in message
news:c905r9$c6s$1@inn.qnx.com

Thank you,

I guess its a stupid question. But, how can i get the socket number for
the
windows machine?

Shashank


“Erick Muis” <> emuis@node55.ott.qnx.com> > wrote in message
news:c9013e$8f4$> 1@inn.qnx.com> …
You could do a simple getpeername and see if the other socket is
connected,
if it returns with a name you can assume it is connected, if it is not
it
will
return ENOTCONN (not connected).

Just a quick suggestion.

Best regards,

Erick

Shashank <> sbalijepalli@precitech.com> > wrote:
I’ll try to be more specific about my question.

I have a qnx and windows machine that are communicating with each
other
using SMBFsys.
The IP address of my QNX computer is “192.168.1.99”
and the IP address of my Windows computer is “192.168.1.125”.

If i invoke the foll. command from a QNX shell “ping 192.168.1.125”, I
can
determine whether the 2 machines are talking to each other or not.

Is there a way to determine their connectivity from my QNX
application?

I will appreciate your help.

Shashank



“Shashank” <> sbalijepalli@precitech.com> > wrote in message
news:c8la22$opj$> 1@inn.qnx.com> …
I wanted to know if there are any Watcom C function/functions I could
use
to
test the network connection.

Thanks,
Shashank

“Erick Muis” <> emuis@node55.ott.qnx.com> > wrote in message
news:c8ktr1$f74$> 1@inn.qnx.com> …
Not really sure what you want. Are you looking for code examples?
are you wondering what functions to use? If you could clarify what
you are looking for then perhaps more people can provide input. If
you are looking for feedback on your prototype, then “it looks
ok to me” > :slight_smile:

Best regards,

Erick

Shashank <> sbalijepalli@precitech.com> > wrote:

I would really appreciate it if someone can give me a hint.

Thank you,
Shashank


“Shashank” <> sbalijepalli@precitech.com> > wrote in message
news:c8iut1$rp7$> 1@inn.qnx.com> …

I have an application on my QNX machine that communicates with
a
windows
machine. I am using SMB. I’d like to have a loop controlled by
a
timer
that
keeps polling the network at regular time intervals to ensure
that
data
is
flowing back and forth.

If there is no network connectivity, I’d like to quit.

Your suggestions are appreciated.

Shashank





\


Erick Muis
Hardware Group
QNX Software Systems Ltd.
Email: emuis at qnx.com





\


Erick Muis
Hardware Group
QNX Software Systems Ltd.
Email: emuis at qnx.com

Try to use fstat or fopen functions on a known existent file in the other
machine.


Shashank wrote:

I wanted to know if there are any Watcom C function/functions I could use to
test the network connection.

Thanks,
Shashank

“Erick Muis” <> emuis@node55.ott.qnx.com> > wrote in message
news:c8ktr1$f74$> 1@inn.qnx.com> …
Not really sure what you want. Are you looking for code examples?
are you wondering what functions to use? If you could clarify what
you are looking for then perhaps more people can provide input. If
you are looking for feedback on your prototype, then “it looks
ok to me” > :slight_smile:

Best regards,

Erick

Shashank <> sbalijepalli@precitech.com> > wrote:

I would really appreciate it if someone can give me a hint.

Thank you,
Shashank


“Shashank” <> sbalijepalli@precitech.com> > wrote in message
news:c8iut1$rp7$> 1@inn.qnx.com> …

I have an application on my QNX machine that communicates with a
windows
machine. I am using SMB. I’d like to have a loop controlled by a timer
that
keeps polling the network at regular time intervals to ensure that data
is
flowing back and forth.

If there is no network connectivity, I’d like to quit.

Your suggestions are appreciated.

Shashank





\


Erick Muis
Hardware Group
QNX Software Systems Ltd.
Email: emuis at qnx.com

Thanks. That seems to work. However, fopen() doesn’t return immediately . So
, if theres an error it takes a few minutes until I can flag an error.
Can I set a timeout for an fopen call or is there any such function?

Shashank

“Joan Baucells” <“Joan Baucells”@NoSpam.es> wrote in message
news:40B4373B.9E38274A@NoSpam.es

Try to use fstat or fopen functions on a known existent file in the other
machine.


Shashank wrote:

I wanted to know if there are any Watcom C function/functions I could
use to
test the network connection.

Thanks,
Shashank

“Erick Muis” <> emuis@node55.ott.qnx.com> > wrote in message
news:c8ktr1$f74$> 1@inn.qnx.com> …
Not really sure what you want. Are you looking for code examples?
are you wondering what functions to use? If you could clarify what
you are looking for then perhaps more people can provide input. If
you are looking for feedback on your prototype, then “it looks
ok to me” > :slight_smile:

Best regards,

Erick

Shashank <> sbalijepalli@precitech.com> > wrote:

I would really appreciate it if someone can give me a hint.

Thank you,
Shashank


“Shashank” <> sbalijepalli@precitech.com> > wrote in message
news:c8iut1$rp7$> 1@inn.qnx.com> …

I have an application on my QNX machine that communicates with a
windows
machine. I am using SMB. I’d like to have a loop controlled by a
timer
that
keeps polling the network at regular time intervals to ensure that
data
is
flowing back and forth.

If there is no network connectivity, I’d like to quit.

Your suggestions are appreciated.

Shashank





\


Erick Muis
Hardware Group
QNX Software Systems Ltd.
Email: emuis at qnx.com

“Shashank” <sbalijepalli@precitech.com> wrote in message
news:c926me$9n$1@inn.qnx.com

Thanks. That seems to work. However, fopen() doesn’t return immediately .
So
, if theres an error it takes a few minutes until I can flag an error.
Can I set a timeout for an fopen call or is there any such function?

There are some timeout setup you can do but they affect the whole network.

Look at netpoll and arguments to Net.

You can also try qnx_net_alive()

Shashank

“Joan Baucells” <“Joan Baucells”@NoSpam.es> wrote in message
news:> 40B4373B.9E38274A@NoSpam.es> …
Try to use fstat or fopen functions on a known existent file in the
other
machine.


Shashank wrote:

I wanted to know if there are any Watcom C function/functions I could
use to
test the network connection.

Thanks,
Shashank

“Erick Muis” <> emuis@node55.ott.qnx.com> > wrote in message
news:c8ktr1$f74$> 1@inn.qnx.com> …
Not really sure what you want. Are you looking for code examples?
are you wondering what functions to use? If you could clarify what
you are looking for then perhaps more people can provide input. If
you are looking for feedback on your prototype, then “it looks
ok to me” > :slight_smile:

Best regards,

Erick

Shashank <> sbalijepalli@precitech.com> > wrote:

I would really appreciate it if someone can give me a hint.

Thank you,
Shashank


“Shashank” <> sbalijepalli@precitech.com> > wrote in message
news:c8iut1$rp7$> 1@inn.qnx.com> …

I have an application on my QNX machine that communicates with a
windows
machine. I am using SMB. I’d like to have a loop controlled by a
timer
that
keeps polling the network at regular time intervals to ensure
that
data
is
flowing back and forth.

If there is no network connectivity, I’d like to quit.

Your suggestions are appreciated.

Shashank





\


Erick Muis
Hardware Group
QNX Software Systems Ltd.
Email: emuis at qnx.com

Mario Charest postmaster@127.0.0.1 wrote:

MC > “Shashank” <sbalijepalli@precitech.com> wrote in message
MC > news:c926me$9n$1@inn.qnx.com

Thanks. That seems to work. However, fopen() doesn’t return immediately .
MC > So
, if theres an error it takes a few minutes until I can flag an error.
Can I set a timeout for an fopen call or is there any such function?

MC > There are some timeout setup you can do but they affect the whole network.

MC > Look at netpoll and arguments to Net.

MC > You can also try qnx_net_alive()

I don’t think these will affect SMB net traffic, will they?

Thanks for the reply. But i’m still a little confused. I am not completely
sure how “Net” and “netpoll” commands work.

I used “netpoll -p 2 -i 2 -r 3” & “Net - t 1”.

As i wrote before:

I’ve used user_smb and mount_smb to mount a windows directory on to my QNX
machine as “/network”. Lets say someone accidentaly disconnects the cable.
I’d like to immediately flag an error rather than have the operator wait for
about a minute (that’s the time it takes now) to flag an error.

Your suggestions are appreciated.

Shashank






“Mario Charest” postmaster@127.0.0.1 wrote in message
news:c93063$ioa$1@inn.qnx.com

“Shashank” <> sbalijepalli@precitech.com> > wrote in message
news:c926me$9n$> 1@inn.qnx.com> …
Thanks. That seems to work. However, fopen() doesn’t return immediately

So
, if theres an error it takes a few minutes until I can flag an error.
Can I set a timeout for an fopen call or is there any such function?

There are some timeout setup you can do but they affect the whole network.

Look at netpoll and arguments to Net.

You can also try qnx_net_alive()


Shashank

“Joan Baucells” <“Joan Baucells”@NoSpam.es> wrote in message
news:> 40B4373B.9E38274A@NoSpam.es> …
Try to use fstat or fopen functions on a known existent file in the
other
machine.


Shashank wrote:

I wanted to know if there are any Watcom C function/functions I
could
use to
test the network connection.

Thanks,
Shashank

“Erick Muis” <> emuis@node55.ott.qnx.com> > wrote in message
news:c8ktr1$f74$> 1@inn.qnx.com> …
Not really sure what you want. Are you looking for code examples?
are you wondering what functions to use? If you could clarify what
you are looking for then perhaps more people can provide input.
If
you are looking for feedback on your prototype, then “it looks
ok to me” > :slight_smile:

Best regards,

Erick

Shashank <> sbalijepalli@precitech.com> > wrote:

I would really appreciate it if someone can give me a hint.

Thank you,
Shashank


“Shashank” <> sbalijepalli@precitech.com> > wrote in message
news:c8iut1$rp7$> 1@inn.qnx.com> …

I have an application on my QNX machine that communicates with
a
windows
machine. I am using SMB. I’d like to have a loop controlled by
a
timer
that
keeps polling the network at regular time intervals to ensure
that
data
is
flowing back and forth.

If there is no network connectivity, I’d like to quit.

Your suggestions are appreciated.

Shashank





\


Erick Muis
Hardware Group
QNX Software Systems Ltd.
Email: emuis at qnx.com


\

“Shashank” <sbalijepalli@precitech.com> wrote in message
news:c94opc$13h$1@inn.qnx.com

Thanks for the reply. But i’m still a little confused. I am not completely
sure how “Net” and “netpoll” commands work.

I used “netpoll -p 2 -i 2 -r 3” & “Net - t 1”.

Forget it, I missed you were using SMB. These only affect FLEE
Looked at the -r option of SMBFsys.

Other option is to set an alarm() before the fopen and any other file
operation.

As i wrote before:

I’ve used user_smb and mount_smb to mount a windows directory on to my QNX
machine as “/network”. Lets say someone accidentaly disconnects the cable.
I’d like to immediately flag an error rather than have the operator wait
for
about a minute (that’s the time it takes now) to flag an error.

Your suggestions are appreciated.

Shashank






“Mario Charest” postmaster@127.0.0.1 wrote in message
news:c93063$ioa$> 1@inn.qnx.com> …

“Shashank” <> sbalijepalli@precitech.com> > wrote in message
news:c926me$9n$> 1@inn.qnx.com> …
Thanks. That seems to work. However, fopen() doesn’t return
immediately
.
So
, if theres an error it takes a few minutes until I can flag an error.
Can I set a timeout for an fopen call or is there any such function?

There are some timeout setup you can do but they affect the whole
network.

Look at netpoll and arguments to Net.

You can also try qnx_net_alive()


Shashank

“Joan Baucells” <“Joan Baucells”@NoSpam.es> wrote in message
news:> 40B4373B.9E38274A@NoSpam.es> …
Try to use fstat or fopen functions on a known existent file in the
other
machine.


Shashank wrote:

I wanted to know if there are any Watcom C function/functions I
could
use to
test the network connection.

Thanks,
Shashank

“Erick Muis” <> emuis@node55.ott.qnx.com> > wrote in message
news:c8ktr1$f74$> 1@inn.qnx.com> …
Not really sure what you want. Are you looking for code
examples?
are you wondering what functions to use? If you could clarify
what
you are looking for then perhaps more people can provide input.
If
you are looking for feedback on your prototype, then “it looks
ok to me” > :slight_smile:

Best regards,

Erick

Shashank <> sbalijepalli@precitech.com> > wrote:

I would really appreciate it if someone can give me a hint.

Thank you,
Shashank


“Shashank” <> sbalijepalli@precitech.com> > wrote in message
news:c8iut1$rp7$> 1@inn.qnx.com> …

I have an application on my QNX machine that communicates
with
a
windows
machine. I am using SMB. I’d like to have a loop controlled
by
a
timer
that
keeps polling the network at regular time intervals to ensure
that
data
is
flowing back and forth.

If there is no network connectivity, I’d like to quit.

Your suggestions are appreciated.

Shashank





\


Erick Muis
Hardware Group
QNX Software Systems Ltd.
Email: emuis at qnx.com




\