Solved

[COM, TCP/IP, Services] Advise, please...

Posted on 2004-08-25
3
156 Views
Last Modified: 2012-05-05
I am using Delphi 5 and my final code will have to run on Windows 2000, XP and 2003. The project that I am working on has a deadline so I can't take much time for complex, time-consuming solutions.

I have the following situation. I need to convert an existing project into a more modernised version. Basically, part of it will become a Windows service and another part will be either a normal application or a control panel application. And it would not be so hard to do if it weren't for the fact that all parts heavily rely on each other.

First of all, the service(s)... The services will be responsible for managing all data to and from it's storage. Unfortunately this isn't some normal database or even a simple file but involves connecting to some special hardware that is connected to the system. What is important here is that the service keeps track of the hardware status even if no application is active.

The hardware that is connected to it (A PBX system) might be generating events that are captured by the service. But the service itself can also send special commands to the hardware. It is expected that there will be a lot of traffic between the service and the hardware. The technique used for this traffic however varies, from serial port to USB to TCP/IP depending on the type of hardware.

There will be several different applications that want to communicate with the hardware and they all have to go through the service. No application will be allowed to bypass the service to connect to the hardware. So, this brings this description to the conclusion and to my questions...

I know there are quite a few techniques to arrange the communications between service(s) and applications but I'm looking at the easiest way to implement a very reliable environment. Robustness is important, especially for the service.

My first idea was using TCP/IP and then define my own protocol to communicate between apps and service. But I don't like this solution that much because it's a bit vulnerable. A firewall could accidently block the traffic and worse, a sniffer could monitor the communications which might result in unwanted situations.

I've considered using named pipes and mailslots, which are a bit more practical but like with TCP/IP I would have to marshall the data myself before sending it from A to B. There will be hundreds of methods in the service that need to be called thus I would need to write lots of code to marshall and unmarshall data.

Another solution I've come up with would make life a lot easier would be the use of plain old COM objects. Even better, all the service would have to do is create one or more COM objects and the applications will have to use these existing COM objects. This would in fact solve my problem of marshalling data since COM will do this for me. And no, no DCOM. Just plain COM.

Of course there would be many other options too  but I like the COM idea. Does anyone have some good experience with this or would you advise some other solution? I would like to see a demo of my suggestion, i.e. a service, COM component and one or more applications communicating with each other. Do they exist?

In other words, any advise?
0
Comment
Question by:Wim ten Brink
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
Lee_Nover earned 500 total points
ID: 11899966
I'd definitively go with RemObjects ... I've used RO for more than a year now and had no problems whatsoever
the transport method can be choosen anytime ... messages (wm_copydata), mailslots, udp, plain tcp, http, email !, direct dll, ...
it's a commercial product but well worth the price (which is not high 300eur)
the learning curve is very steep .. just go over a few examples and you're done .. or even follow an example to create what you need in the first try
I know I've replaced services+dcom (that couldn't get working in 2 weeks) with an example from RO in 2 hours .. it has worked from the first try and ever since :)
http://www.remobjects.com/page.asp?id={364BA043-7A12-4453-8F96-97BDA56BC0E0}
0
 
LVL 17

Author Comment

by:Wim ten Brink
ID: 11902285
RemObjects... I've considered them for a short moment but then I have to convince my boss to upgrade to Delphi 6 or 7... Something that would be a bit expensive and might require us to rewrite quite a few things in our current libraries. (Or buy upgrades for these too...) And there will definitely be NO SUPPORT for .NET in this all.

The product I'm working on has two parts... The service is connected to a PBX system (Large telephony box) and monitors everything that is happening on it. So when calls are made, forwarded, disconnected or whatever more, the service responds to it. Now, other applications can be running on the same machine, providing all kinds of services. For example, a call recording application might record calls from certain phonelines. Another monitoring application might just measure the length of phonecalls and maintain a list of calls made. A third application might be sending and receiving faxes. The fourth will just send SMS messages. All in all there could be dozens of applications active and most of them will be running on the same system, although a few might be running on a remote system. The service itself will just have to maintain an overview of the current status of the PXB system and respond to events from the PBX system.

As I said, we already have an existing solution but it doesn't use services. As such it is a bit too fragile. As a service the main module would be more robust. But I need to keep things very simple too, since other developers might have to maintain the code I'm writing. And it's not like a webservice that's just active whenever a request is made. No, the service is continuously active, monitoring the hardware. As if it's a device driver, kicking events to all other applications that are connected to it. Which is why I'm thinking more to a simpler COM approach. Most applications will be running locally anyway. For the remote applications there's already a working solution in our current setup. A local application serving as server, which would become a second service application in the near future. (Thus a client connect to this service, the service to a COM object and the COM object to the second service.)
0
 
LVL 17

Author Comment

by:Wim ten Brink
ID: 12048707
Well, if RemObjects is the best answer I get on my question then I'll have to accept this as the answer. I asked for opinions, I got just one...

Thank you, Lee, for your opinion about the subject. I might not fully agree but hey, I asked for advise and you were the only one giving any. :-)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 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

15 Experts available now in Live!

Get 1:1 Help Now