Solved

Delphi 2009 TCP communication system

Posted on 2010-11-25
6
594 Views
Last Modified: 2012-05-10
I'm using Delphi 2009 and I'm trying to put together a kind of client and server communication system for product authentication.

Essentially, the server application will sit on a Win 2008 box and wait for clients to announce themselves.

A client sends a serial number which the server looks up in a database.

If the serial number is disabled then the server sends back a "get lost" message and closes the socket connection.

If the serial number is authenticated then the server will communicate with the client as neccessary.

I've tried a few TCP components to test the process but I'm having a similar issue with all of them - the number of concurrent connections is not sufficient.

For each "server", I've built a client capable of initiating multiple connections.  When testing locally (server and client using 127.0.0.1), the best I've managed is about 30,000 connections but testing between two Win 2003 servers in a datacenter is giving much worse results - about 5,000 connections before I start getting drop outs.

I believe that Win 2003 / 2008 should be able to support around 100,000 connections so I'm at a loss as to why I'm seeing such low numbers in testing.

If anyone has any suggestions or, better still, some example code to get beyond the limits I'm experiencing then that would would be awesome.

Thx, Adam
0
Comment
Question by:aburgoyne
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 25

Expert Comment

by:epasquier
ID: 34215901
I'm pretty sure this is a system limitation, not a component limitation.
I mean, if you tried the 3 most common sets :
- TServerSocket (delphi old WinSock wrapper)
- ICS (Internet Component Suite)
- Indy
and they all give you the same problems, then you should not look the solution in the code, but in some registry parameter or OS documentation about CNX limitations
0
 
LVL 25

Accepted Solution

by:
epasquier earned 500 total points
ID: 34215919
http://smallvoid.com/article/winnt-tcpip-max-limit.html

That is a strong limit
[HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services \Tcpip \Parameters]
MaxUserPort = 5000 (Default = 5000, Max = 65534)

max cnx = MaxUserPort - 1024
so even set to 65534, that gives 64510 max connexions, whatever the system
0
 
LVL 25

Expert Comment

by:epasquier
ID: 34215940
defaults are a bit different for Vista / 2008
http://support.microsoft.com/kb/929851/en-us?fr=1
0
Optimum High-Definition Video Viewing and Control

The ATEN VM0404HA 4x4 4K HDMI Matrix Switch supports 4K resolutions of UHD (3840 x 2160) and DCI (4096 x 2160) with refresh rates of 30 Hz (4:4:4) and 60 Hz (4:2:0). It is ideal for applications where the routing of 4K digital signals is required.

 
LVL 25

Expert Comment

by:epasquier
ID: 34215957
Check that limitation as well :

[HKEY_LOCAL_MACHINE \System \CurrentControlSet \services \Tcpip \Parameters]
MaxFreeTWTcbs = 1000 (Default = 1000 sockets)
0
 

Author Comment

by:aburgoyne
ID: 34222714
Hi, epasquier - thanks for the information.

I tried the registry settings suggested and it has improved things but I'm still topping out at about 16,000 connections :-(

I need to get as far above 50,000 as possible (65,000 seems to be the ceiling) so any other ideas?

rgds, Adam
0
 

Author Comment

by:aburgoyne
ID: 34227622
Just couldn't get sufficient connections with TCP so now looking at UDP.

Thanks anyway.

Adam
0

Featured Post

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month5 days, 6 hours left to enroll

636 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