• Announcements

    • Reminder - MoDaCo position on illegal content   07/30/15

      ILLEGAL CONTENT I'd like to just reaffirm MoDaCo's position regarding piracy and illegal content in the light of some recent questions / postings. Posts will be censored by myself or my moderation team if the contain or link to: Illegal / pirated / cracked software or sites that host such softwareNintendo emulators / ROMs or sites hosting them (in light of Nintendo's legal stance)CUSTOM ROMS You may discuss and post links to custom device ROMs on MoDaCo, provided the following rules are adhered to: ROMs must not contain any illegal 3rd party software (this includes trial versions included without permission)ROMs must give full credit to the original authorISSUES If you have any issues with this policy, please contact PaulOBrien directly via PM.
    • Reminder: Selling items on the forum directly is not allowed   07/30/15

      Please note that selling items on the forum directly is not allowed by the forum rules. There is a forum for eBay auctions whereby you can list the items on eBay and link to them there. This is the ONLY forum for this type of activity. You may also advertise links to the eBay forum in your signature. Please note that selling directly in contravention of these rules will result in a warning / suspension / ban.
Sign in to follow this  
Followers 0

HTTP Server Check program

6 posts in this topic

Posted · Report post

Hi All,

I posted a question on one of the other forums to see if there was such a program that can monitor a server to see if it is up. I didn't get any replies so i thought i could purhapes try and create this simple app myself.

Anyway, so far i have thought of maybe using IE to try and load the index page of the user specified server to monitor. Is this possible? Can you create instance of pocket IE? I have done this before in VB and FoxPro but i have never done any programming for a PocketPC device.

If i was able to create an IE object, i assume that this would fire up an internet connection by GPRS if one was not available?

Any thoughts on this programme?

Cheers :)

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Firing up IE sounds a bit clumsy to me.

You can access a webserver directly from .net. If you use HttpWebRequest, the GPRS connection will also fire up automatically. The C# syntax is more or less this:

using System.Net;

.

.

.

			try

			{

				String urlString = "www.example.com";

				HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlString );

				WebResponse resp = request.GetResponse(); 

			}

		   catch

			{

				// You will end up here if the server is not responding, or if the GPRS 

				// connection is not working

			}

A few notes:

Even for an empty page, this will create 4-5 kB of traffic per request.

If you only want to check that the server hardware and operating system is running, you could use some of the more low level networking stuff in System.Net.Sockets to send an UDP packet (works) or perhaps an ICMP Echo Request (not tested). This will create less than 100 bytes of traffic per request. However, this will not fire up the GPRS connection, and it is more difficult to program.

If you debug your application by deploying it to your device from within VS, the network connection will go through ActiveSync, and UDP will not work. This can be very confusing. Unplug the cable, and the network connection will go through GPRS and UDP will work, but you will be unable to debug from the PC.

All of the above relates to a smartphone without WiFi. Especially the GPRS part may be different for a PDA.

Edited by Allan Olesen
0

Share this post


Link to post
Share on other sites

Posted · Report post

Ah, some good info there. Thanks very much.

Question for you, you might not know the answer though. If i have a timer running in my app, does it fire if the pda side of the device is in standby? Probably no.

0

Share this post


Link to post
Share on other sites

Posted · Report post

If i have a timer running in my app, does it fire if the pda side of the device is in standby? Probably no.

You are rigth: I don't know.

But I assume that a normal software timer will run as part of your program. As your program does not run when the PDA is in standby, I doubt it will work.

But you may be able to access some kind of hardware timer programmatically.

0

Share this post


Link to post
Share on other sites

Posted · Report post

There must be some way of doing that as a calender notification fires and brings the pda out of sleep.

0

Share this post


Link to post
Share on other sites

Posted · Report post

There must be some way of doing that as a calender notification fires and brings the pda out of sleep.

Have a look at Notify.RunAppAtTime in OpenNetCF. It will set a system notification which is supposed to be able to wake the device from standby. Example here. I have not tested it.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

MoDaCo is part of the MoDaCo.network, © Paul O'Brien 2002-2015. MoDaCo uses IntelliTxt technology.