This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Hi all just looking for some advice on part of a project I;m involved with.
I have developed a site for gps tracking & navigation, customers can log in and see the location of their devices and more.. the devices in question have different modes of operation, they can report their location by SMS, HTTP Requests or via Sockets. At the moment I have servlets which cover the SMS & HTTP methods but want to start on a socket server, as it is much more cost effective for the customer and when the device is connected, it allows realtime communication with the device itself, which makes configuration far easier to perform.
Now my initial idea is to develop a standalone socket server, with gui. which I can run anywhere, but initally will run on the same server as the website. Where I'm getting confused is deciding the best approach so that my website can detect when a customers device is connected to the socket server and can communicate with the device itself. I want the socket server to be as loosely coupled as possible, So I'm wondering the best way for my servlet to ask the/a socket server if the device is connected.. RMI perhaps ? Although that will be new territory for me. .
Any thoughts appreciated..
Regards, Dave Brown
SCJP 6 - [url]http://www.dbws.net/[/url] - Check out Grails Forum
Since you're using sockets anyway, why not let the web app connect to the socket server over a TCP/IP socket as well? It would be on a different port, probably with some kind of authentication, but it would keep the socket nature of the server.
That would mean writing my own protocol for my own internal conversations between webapp & socket server app wouldnt it. I was under the impression RMI etc will enable me to skip that and just access & pass objects/call methods etc..
Joined: Mar 22, 2005
Yes, RMI does that, but it also introduces complications of its own. It really depends on how complex your access needs are. Even with just a socket connection you could communicate by serializing Java objects over it.