Solved

Need to write a server type app to respond to requests

Posted on 2006-11-23
4
204 Views
Last Modified: 2010-04-23
Hi All,

I would like to write an app that does vehicle tracking. I have an idea that I could send the data over wireless internet, maybe gprs at this stage. The app, written in .net 2005, will send data to a web service at a given interval.

I need to be able to "poll" my vehicle and get it to return the vehicle position etc back, so thinking I may need the app to do some "servery" type things. I haven't done much in this area before, but I am guessing that if the tracking app runs its own sort of web server, the person or whatever that is polling this vehicle would then consume the service running on the vehicle?

Or am I way off!! LOL

Looking forward to hearing all the ideas!!

Thanks
0
Comment
Question by:nzfire
  • 2
  • 2
4 Comments
 
LVL 15

Expert Comment

by:Solar_Flare
ID: 18005411
so does the application in your car need to respond to poll requests from your house/office/whereever, or can it just send data at certain intervals.

having the car respond to requests means that yes, you need something running in your car listening for requests. if it is over wireless internet and you are able to 'connect' to your cars computer then you could easily write a small app that has a tcp listener running on a certain port. you could then connect on that port to the cars IP address and have the server application in the car send back the gps numbers.


is this the sort of thing you are trying to do?
0
 
LVL 1

Author Comment

by:nzfire
ID: 18005452
Hi Again Solar_Flare,

I would like it to do both. The vehicle will send data at an interval, and if required during this interval, a user can manually poll it. Polling the vehicle would also be good to determine that it is still connected etc etc..

What you have said is exactly what I would like to do!

Now, I would need the applications either side to both be able to send and receive data. I did something in VB6 a few years ago to keep an application (db) in sync with other workstations. Basically when a change was done on one workstation and another was viewing the same data, it would send a message to all workstations and refresh their screen.

I suppose this would be the way to go then? well similar at least.

0
 
LVL 15

Accepted Solution

by:
Solar_Flare earned 500 total points
ID: 18005692
yes both your car and the other end will need to be listening for incoming connections in the background, and also able to send data at will.

The best way to deal with this is to use TCPClient and TCPListener classes.
http://msdn2.microsoft.com/en-us/library/system.net.sockets.tcplistener.aspx
http://msdn2.microsoft.com/en-us/library/system.net.sockets.tcpclient.aspx

and a bit of an example around making a chat program, which is essentially what you want to do except that instead of displaying messages you want to process them for gps coordinates etc.
http://www.dotnet247.com/247reference/a.aspx?u=http://msdn.microsoft.com/library/en-us/dnadvnet/html/vbnet08282001.asp?frame=true
0
 
LVL 1

Author Comment

by:nzfire
ID: 18006429
Perfect, thanks.

Is very similar to what I did in vb6, but haven't got the source...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now