SOAP Server doesn't support more than 2 simultaneously calls

Hello,
This is my situation: I have developed a SOAP server with one procedure that takes around 2 seconds to complete its task, and a client app that tries to simulate multiple clients connecting to my server. The problem is that my client calls are serialized and my server doesn’t seem to be multithreaded. Below you can find my server procedure, and I also uploaded a testcase. So my question is what I must do to support more than 2 connections at a time.

Using Delphi XE2, Remobjects 7.0.71.1093

Best regards,
Cristian Vasuica

Soap_REMSupport_TestCase.zip (3.0 MB)

function TServicii.Test: AnsiString;
var t0, t1, Duration : Cardinal;
    Guid : tguid;
    RGuid : HRESULT;
    received : boolean;
const MaxTime : Cardinal = 3000;
begin
  Result := '';
  RGuid := CreateGuid(Guid);
  if RGuid = S_OK then
    Result := GuidToString(Guid);
  t0 := GetTickCount;
  t1 := GetTickCount;
  duration := t1 - t0;
  while (Duration < Maxtime) do begin
   { In this section I call a CreateProcess of another VFP program that performs some calculations
    and writes the result in a dbf file. I wait for the VFP program to terminate it's execution,
    but not more than MaxTime. }
    if received then begin
      Result := Result + '_RECEIVED_' + DateTimeToStr(Now);
      Break;
    end;
    t1 := GetTickCount;
    duration := t1 - t0;
    if duration > Maxtime then begin //MaxTime allowed is exceded
      Result := Result + '_NOTRECEIVED_' + DateTimeToStr(Now);
      Break;
    end;
  end;
end;

Hello,
Connections to a single HTTP 1.1 server are limited to two simultaneous connections.
http://support.microsoft.com/kb/183110

Please try to use Indy on Synapse channels instead of WinInet.

I missed this one… thank you very much vovanl, and I apologize for asking dumb questions at times.
Best regards,
Cristian Vasuica

Hi, this could be solved in a simple way.

Wherever you use TROWinInetHTTPChannel, you can call this method once per process, to set the maximum of HTTP/1.1 persistent connections allowed per server - in every subsequent WinInet call (threads included):

implementation

uses Winapi.WinInet;

procedure InitWinInet(aMaxCon: Integer);
var
  MaxCon: Integer;
begin
  MaxCon := aMaxCon;
  InternetSetOption(nil, INTERNET_OPTION_MAX_CONNS_PER_SERVER, @MaxCon, SizeOf(MaxCon));
end;