7

I am building a small multipliplayer which will need the following:

  • it must be written in Delphi
  • must support Internet connection (not only LAN)
  • work over HTTP
  • support some encryption of the packets (it may be custom)
  • be able to send commands to the server
  • be able to receive responses from the server
  • be able to connect up to 8 players to one server
  • be able to pass complex objects (maybe JSON serialized) to the servers

Do you think the new Delphi 2010 Datasnap can be used successfully in this scenario or should I go with the plain old TSocket?

3 Answers 3

10

DataSnap can do all that you've listed above:

  1. DataSnap is written in Delphi.
  2. It can connect via HTTP over any connection, local, network, or remote.
  3. It will work over HTTP, including support for tunneling the HTTP connection
  4. You can filter the data stream however you like. The product includes a compression filter. Daniele Teti has written some very nice encryption filters.
  5. You can send commands to the server by calling server methods
  6. You can receive a response from the server via server callbacks
  7. You can easily connect eight people to a server
  8. You can pass JSON objects. That is the default type sent between client and server.

So to answer your question, yes, I think that the new Delphi 2010 DataSnap can be used in your scenario.

1
  • Beware that the "very nice filters" above are not secure at all - because you'd need a safe way to exchange the session key.
    – user160694
    Dec 6, 2009 at 18:27
3

As Nick said, the answer is Yes.

Bob Swart wrote a white paper and produced some videos on the updated DataSnap in Delphi 2010 that can help get you started.

1

If your multiplayer game doesn't send much data HTTP and Datasnap may work. If you need a fast communication, I'd use UDP and custom binary protocol. Unless you have to bypass a company firewall that stops almost any protocol but HTTP - and companies usually don't like people playing in their working hours - a firewall blocks incoming connection, not outgoing. Just the server needs open ports to allow clients to connect. And I'd avoid JSON as well - if you don't need interoperability a binary serialization is much faster.

3
  • You mean that even using port 80 in enterprise network the firewall can block the communication (being incoming)?
    – Gad D Lord
    Dec 4, 2009 at 22:28
  • A proper managed firewall won't allow incoming connection to port 80 but for allowed web servers (usually in a DMZ or the like). Client can send HTTP request to outside webservers on port 80, and receive answer, but a server inside the nwtwork can't receive request unless the firewall allows it.
    – user160694
    Dec 6, 2009 at 18:25
  • You are right, AFAIK UDP is not routable outside the local network (unless you do some complex NAT), whereas HTTP/TCP is. For performance perspective, I would never use DataSnap - but here, the requirement is up to 8 clients, so in this case DataSnap will handle it seamlessly. Jun 28, 2014 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.