Home All Groups Group Topic Archive Search About

Connected App (VB2005) Help...

Author
12 Dec 2006 3:48 AM
Shane Story
I need to have an app run on several machines in a LAN.  They all need to
know of each other's existence and be able to communicate simple messages
back and forth.  These messages should be directed to all or just to an
individual.

I wrote this app in VB 2003.  Basic Windows Forms programs with system tray
app, and they each connected to a Service on a machine.
The problem was that for some reason the service or the connections don't
seem to survive to the next day.  I have no idea why.  I have notice other
people's VB services that seem to hang over time.

1.) Any thoughts on why VB services hang?
2.) There may be a better way to do this.  I original took the sample code
for a chat program and modified it to do this sort of thing.  Is there a
better way to accomplish this?  Would you recommend doing so without the
need of a service?  Basically I want each user to have this app.  It should
start up on login and automatically be in communication with the same app on
all other computers and thus be able to receive messages and respond.

Any suggestions/links as to how I can learn to do this better and so that it
doesn't hang up would be greatly appreciated.

Thanks,

Shane

Author
12 Dec 2006 5:15 AM
Tom Shelton
Shane Story wrote:
> I need to have an app run on several machines in a LAN.  They all need to
> know of each other's existence and be able to communicate simple messages
> back and forth.  These messages should be directed to all or just to an
> individual.
>
> I wrote this app in VB 2003.  Basic Windows Forms programs with system tray
> app, and they each connected to a Service on a machine.
> The problem was that for some reason the service or the connections don't
> seem to survive to the next day.  I have no idea why.  I have notice other
> people's VB services that seem to hang over time.
>

Is it possilbe that the machine is powering down the nic?  I've had it
happen.

> 1.) Any thoughts on why VB services hang
> 2.) There may be a better way to do this.  I original took the sample code
> for a chat program and modified it to do this sort of thing.  Is there a
> better way to accomplish this?  Would you recommend doing so without the
> need of a service?  Basically I want each user to have this app.  It should
> start up on login and automatically be in communication with the same app on
> all other computers and thus be able to receive messages and respond.
>
> Any suggestions/links as to how I can learn to do this better and so that it
> doesn't hang up would be greatly appreciated.

Your on a LAN, so I might consider that each client could on startup
send out a simple UDP brodcast, telling anyone interested that they are
alive.  all other clients could respond with a udp brodcast of their
own giving up their locations.  they could broadcast their locations,
so then you could establish a tcp connection if reliable transport is
required.

--
Tom Shelton
Author
12 Dec 2006 6:05 PM
sstory
Tom,

Thanks for the reply.  I suppose that could be happening.  Whatever happens,
it won't work again until I restart the service.
I am very new to TCP UDP programming. I just took this example and did the
best I could.

Ok. I have thought of UDP.  To broadcast, do open IP 255--the broadcast IP
for our network?  Or is there some easier way?  It's the technicality of all
of this as well as the theory that I am still fuzzy on.  With TCP and a
server, I at least knew where (IP-wise) I was connnecting.  I want this
program to be flexible enough that if it works fine here, I could let other
people install it also.  I guess then if I did a broadcast and you do use
the broadcast IP (255), what do you do if the network does subnetting so
that 255 isn't the broadcast? Is there a way to find that out?  Am I totally
off track on me thinking?

Any good material I could read to better understand this?

Thanks,

Show quoteHide quote
"Tom Shelton" <tom_shel***@comcast.net> wrote in message
news:1165900543.990454.108670@80g2000cwy.googlegroups.com...
>
> Shane Story wrote:
>> I need to have an app run on several machines in a LAN.  They all need to
>> know of each other's existence and be able to communicate simple messages
>> back and forth.  These messages should be directed to all or just to an
>> individual.
>>
>> I wrote this app in VB 2003.  Basic Windows Forms programs with system
>> tray
>> app, and they each connected to a Service on a machine.
>> The problem was that for some reason the service or the connections don't
>> seem to survive to the next day.  I have no idea why.  I have notice
>> other
>> people's VB services that seem to hang over time.
>>
>
> Is it possilbe that the machine is powering down the nic?  I've had it
> happen.
>
>> 1.) Any thoughts on why VB services hang
>> 2.) There may be a better way to do this.  I original took the sample
>> code
>> for a chat program and modified it to do this sort of thing.  Is there a
>> better way to accomplish this?  Would you recommend doing so without the
>> need of a service?  Basically I want each user to have this app.  It
>> should
>> start up on login and automatically be in communication with the same app
>> on
>> all other computers and thus be able to receive messages and respond.
>>
>> Any suggestions/links as to how I can learn to do this better and so that
>> it
>> doesn't hang up would be greatly appreciated.
>
> Your on a LAN, so I might consider that each client could on startup
> send out a simple UDP brodcast, telling anyone interested that they are
> alive.  all other clients could respond with a udp brodcast of their
> own giving up their locations.  they could broadcast their locations,
> so then you could establish a tcp connection if reliable transport is
> required.
>
> --
> Tom Shelton
>
Author
14 Dec 2006 7:15 PM
sstory
I found some great code for UDP and got it working.

Thanks Tom
Show quoteHide quote
"Tom Shelton" <tom_shel***@comcast.net> wrote in message
news:1165900543.990454.108670@80g2000cwy.googlegroups.com...
>
> Shane Story wrote:
>> I need to have an app run on several machines in a LAN.  They all need to
>> know of each other's existence and be able to communicate simple messages
>> back and forth.  These messages should be directed to all or just to an
>> individual.
>>
>> I wrote this app in VB 2003.  Basic Windows Forms programs with system
>> tray
>> app, and they each connected to a Service on a machine.
>> The problem was that for some reason the service or the connections don't
>> seem to survive to the next day.  I have no idea why.  I have notice
>> other
>> people's VB services that seem to hang over time.
>>
>
> Is it possilbe that the machine is powering down the nic?  I've had it
> happen.
>
>> 1.) Any thoughts on why VB services hang
>> 2.) There may be a better way to do this.  I original took the sample
>> code
>> for a chat program and modified it to do this sort of thing.  Is there a
>> better way to accomplish this?  Would you recommend doing so without the
>> need of a service?  Basically I want each user to have this app.  It
>> should
>> start up on login and automatically be in communication with the same app
>> on
>> all other computers and thus be able to receive messages and respond.
>>
>> Any suggestions/links as to how I can learn to do this better and so that
>> it
>> doesn't hang up would be greatly appreciated.
>
> Your on a LAN, so I might consider that each client could on startup
> send out a simple UDP brodcast, telling anyone interested that they are
> alive.  all other clients could respond with a udp brodcast of their
> own giving up their locations.  they could broadcast their locations,
> so then you could establish a tcp connection if reliable transport is
> required.
>
> --
> Tom Shelton
>