Offline Application Block

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The Offline Application Block sample code works really well. I am looking for one peice of functionality that they did not include. I would like to find out if a host computer is available, and even a particular web service. Once it has detected those, then I would like to be considered 'Connected'

I am new to C#, but I can figure some of it out. I have no problem putting my own code in the code they have (ok, a copy of their code :) ). I don't see how I can put a host name or web service in there to check and see if they are available. Is there some way I can do a ping? Maybe have their code tell me that I am connected, and then seperate code to ping? I am open to ideas!

Thanks
Brad
 
Ok, I have slightly answered my own question, now I need a little more help

In the help file for the Offline Application Block, in Chapter 2 under the 'IConnectionDetectionStrategy Interface' (2nd paragraph), it states
Application developers can create their own connection detection strategy by implementing this interface and specifying the necessary configuration information in the application’s configuration file

This is what I am looking for. I have developed code that detects a connection in the manner I would like to implement. Now, how do I make my code pluggable? AND how do I plug it in

Some Samples would be great

Thanks
Brad Simon
 
I am glad I am impatient. I have solved my own problem, again. Not very good at c#, I still created a new connection strategy, and made it work. I built it to work around the TCPClient in the Systems.NET.Sockets namespace. It simply makes a connection, and closes it. If an error occurs, you are not connected

It allows you to specifiy the host and the port in the App.config file, along with the rest of the stuff the Offline Application Block puts in there. It was pretty easy, after I stared at the code long enough

E-mail me, if you are interested in the code I used, I will be more than happy to send it to you. It may not be the most beautiful code, but it seems to be working really well. You may want to perform your own tests on it

Thanks
Brad Simon
 
Hi simon,
I'm in trouble with the Offline Application BLock: I'm trying to
understand if I can use it as a start blcok for my objective: develop an
applicaion that detects the state of the connection, and when connected
syncronize some data.
My problem is that I must be able to detect the type of the connection:
in different moments there colud be a wi-fi conneciton, or gsm
connection, or umts, etcetera. SO I think i have to go deeper into
ConnectionDetectionStratgey, to make it able not only to see if there is
or not connection (using winInet API), but also what kind of connection
it can use.
Hope I esplained clearly...

I have read your posts and I would like to see your code, maybe it can
help me to understand what I got to do.
I tried to find your profile in this site, but I wasn't able to find it
out... :) so please could you send me the code at:

il.cesko [at] virgilio.it

Thanks for your help, I will post any future significant work.
Francesco Casonato

PS sorry for my english, I'm just an italian student :)
 
Hi, I would be interested in your code, but I can't find out your
e-mail!!!
Could you send me at il.cesko [at] virgilio.it?

I'm trying to modify the block to make it able to detect differet kind
of connections (gsm, UMTS etc.) and maybe your cod ecan help me.
Thanks and sorry for the OT.

Francesco Casonato
 
Back
Top