Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2004

Tip: Looking for answers? Try searching our database.

Offline Application Block

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brad Simon - 26 Apr 2004 15:31 GMT
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
Brad Simon - 26 Apr 2004 19:41 GMT
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
Brad Simon - 26 Apr 2004 21:11 GMT
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
francesco casonato - 10 May 2004 09:07 GMT
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 :)
francesco casonato - 10 May 2004 09:47 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.