views:

225

answers:

5

I have a server and some clients (about 50) in an intranet. The clients send short (about 40 character) string data to the server and the server answers with a similar string. There are up to (but not permanently) 2-3 requests per second for each client. The server has to serialize the requests to get the response strings.

The system should have as less as possible impact on the network as possible (i.e. the server may run something like a webserver already). It should be as easy to install and administer as possible.

What are the possibilities to achieve this using Delphi (Client: D7, Server up to D2010)?

+4  A: 

What about Indy's TIdTCPServer and TIdTCPClient? They provide command handlers, which makes implementing text-based protocols very straight-forward.

Smasher
I already have a look at those. Only wanted to gather suggestions...
Uwe Raabe
+2  A: 

There are a lot of options.

Ultimately, I agree with Smasher and like using sockets. They're quick, easy and portable. If you're dealing with a fairly simple protocol and don't need a full n-tier solution, creating a TCP or HTTP server application is dead simple, very light weight, and easy to make compatible with any client. You can even add SSL support to these stand alone applications without having to configure a web server or interfering with it, if it's already running on the same box.

Bruce McGee
The SSL is an interesting idea.
Uwe Raabe
It's one less external requirement for my application to worry about. I like XCopy install for servers as much as I do for client apps. :)
Bruce McGee
+5  A: 

I use the Synapse library for such a simple server. Its lightning fast, very light, and threads easily. The demo Echo in the main synapse install is a fantastic start for what your trying to do. If you are going to be performing database access inside each request/response thread then I strongly also suggest looking at the connection pool example by Cary Jensen to keep your database connections in check.

skamradt
Will have a look.
Uwe Raabe
Given the download page Synapse has still only experimental D2009 support. This doesn't give much confidence IMHO.
Uwe Raabe
I have used it with both Delphi 2009 and 2010 without any problems. Support is available via email and is very responsive.
skamradt
+5  A: 

TCP, definitely. But I'd like to give a vote for ICS. Never liked Indy ...

gabr
ICS and Indy seem to be quite comparable. Can you elaborate WHY you never liked Indy?
Uwe Raabe
ICS is completely asynchronous and that fits the TCP/IP model better.
gabr
A: 

I use RemObjects SDK for this sort of purpose. It takes care of all the difficult stuff, and I just ask it to connect and make function calls to pass the data.

mj2008