You've already forked lazarus-ccr
use TByteDynArray for buffer instead of string :
correction for tcp transport correction for library transport git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@809 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -449,7 +449,7 @@ begin
|
||||
i := Length(AData);
|
||||
WriteInt32S(i);
|
||||
if ( i > 0 ) then
|
||||
FStream.Write(AData[1],i);
|
||||
FStream.Write(AData[0],i);
|
||||
end;
|
||||
|
||||
{$IFDEF WST_UNICODESTRING}
|
||||
@ -637,7 +637,7 @@ begin
|
||||
i := ReadInt32S();
|
||||
SetLength(Result,i);
|
||||
if ( i > 0 ) then
|
||||
FStream.ReadBuffer(Result[1],i);
|
||||
FStream.ReadBuffer(Result[0],i);
|
||||
end;
|
||||
|
||||
{$IFDEF WST_UNICODESTRING}
|
||||
|
@ -125,7 +125,7 @@ begin
|
||||
wrtr.WriteAnsiStr(Self.Format);
|
||||
SetLength(binBuff,ARequest.Size);
|
||||
ARequest.Position := 0;
|
||||
ARequest.Read(binBuff[1],Length(binBuff));
|
||||
ARequest.Read(binBuff[0],Length(binBuff));
|
||||
wrtr.WriteBinary(binBuff);
|
||||
buffStream.Position := 0;
|
||||
wrtr.WriteInt32S(buffStream.Size-4);
|
||||
|
@ -163,13 +163,9 @@ begin
|
||||
frmt := rdr.ReadAnsiStr();
|
||||
buff := rdr.ReadBinary();
|
||||
|
||||
{$IFDEF WST_DBG}
|
||||
WriteLn(buff);
|
||||
{$ENDIF}
|
||||
|
||||
rdr := nil;
|
||||
locInStream.Size := 0;
|
||||
locInStream.Write(buff[1],Length(buff));
|
||||
locInStream.Write(buff[0],Length(buff));
|
||||
SetLength(buff,0);
|
||||
locInStream.Position := 0;
|
||||
rqst := TRequestBuffer.Create(trgt,ctntyp,locInStream,locOutStream,frmt);
|
||||
@ -179,7 +175,7 @@ begin
|
||||
i := locOutStream.Size;
|
||||
SetLength(buff,i);
|
||||
locOutStream.Position := 0;
|
||||
locOutStream.Read(buff[1],i);
|
||||
locOutStream.Read(buff[0],i);
|
||||
locOutStream.Size := 0;
|
||||
wrtr := CreateBinaryWriter(locOutStream);
|
||||
wrtr.WriteBinary(buff);
|
||||
|
@ -105,9 +105,10 @@ procedure TLIBTransport.SendAndReceive(ARequest, AResponse: TStream);
|
||||
Var
|
||||
wrtr : IDataStore;
|
||||
buffStream : TMemoryStream;
|
||||
strBuff : TBinaryString;
|
||||
buff : TByteDynArray;
|
||||
intfBuffer : IwstStream;
|
||||
bl : LongInt;
|
||||
errorStrBuffer : ansistring;
|
||||
{$IFDEF WST_DBG}
|
||||
s : TBinaryString;
|
||||
i : Int64;
|
||||
@ -121,23 +122,19 @@ begin
|
||||
wrtr.WriteAnsiStr(Target);
|
||||
wrtr.WriteAnsiStr(ContentType);
|
||||
wrtr.WriteAnsiStr(Self.Format);
|
||||
SetLength(strBuff,ARequest.Size);
|
||||
SetLength(buff,ARequest.Size);
|
||||
ARequest.Position := 0;
|
||||
ARequest.Read(strBuff[1],Length(strBuff));
|
||||
{$IFDEF WST_DBG}
|
||||
if IsConsole then
|
||||
WriteLn(strBuff);
|
||||
{$ENDIF WST_DBG}
|
||||
wrtr.WriteAnsiStr(strBuff);
|
||||
ARequest.Read(buff[0],Length(buff));
|
||||
wrtr.WriteBinary(buff);
|
||||
buffStream.Position := 0;
|
||||
wrtr.WriteInt32S(buffStream.Size-4);
|
||||
|
||||
buffStream.Position := 0;
|
||||
intfBuffer := TwstStream.Create(buffStream);
|
||||
bl := MAX_ERR_LEN;
|
||||
strBuff := StringOfChar(#0,bl);
|
||||
if ( FHandler(intfBuffer,Pointer(strBuff),bl) <> RET_OK ) then
|
||||
raise Exception.Create(strBuff);
|
||||
errorStrBuffer := StringOfChar(#0,bl);
|
||||
if ( FHandler(intfBuffer,Pointer(errorStrBuffer),bl) <> RET_OK ) then
|
||||
raise Exception.Create(errorStrBuffer);
|
||||
|
||||
buffStream.Position := 0;
|
||||
AResponse.Size := 0;
|
||||
|
@ -51,7 +51,8 @@ function wstHandleRequest(
|
||||
end;
|
||||
|
||||
Var
|
||||
buff, trgt,ctntyp, frmt : TBinaryString;
|
||||
trgt,ctntyp, frmt : TBinaryString;
|
||||
binBuff : TByteDynArray;
|
||||
rqst : IRequestBuffer;
|
||||
rdr : IDataStoreReader;
|
||||
inStream, bufStream : TMemoryStream;
|
||||
@ -82,12 +83,12 @@ begin
|
||||
trgt := rdr.ReadAnsiStr();
|
||||
ctntyp := rdr.ReadAnsiStr();
|
||||
frmt := rdr.ReadAnsiStr();
|
||||
buff := rdr.ReadAnsiStr();
|
||||
binBuff := rdr.ReadBinary();
|
||||
rdr := nil;
|
||||
bufStream.Size := 0;
|
||||
bufStream.Position := 0;
|
||||
inStream.Write(buff[1],Length(buff));
|
||||
SetLength(buff,0);
|
||||
inStream.Write(binBuff[0],Length(binBuff));
|
||||
SetLength(binBuff,0);
|
||||
inStream.Position := 0;
|
||||
rqst := TRequestBuffer.Create(trgt,ctntyp,inStream,bufStream,frmt);
|
||||
HandleServiceRequest(rqst);
|
||||
|
@ -279,6 +279,8 @@ begin
|
||||
end;
|
||||
Freemem(AService^.Operations, k * SizeOf(TServiceOperation) );
|
||||
AService^.Operations := nil;
|
||||
end;
|
||||
if ( AService^.Properties <> nil ) then begin
|
||||
ClearProperties(AService^.Properties);
|
||||
AService^.Properties := nil;
|
||||
end;
|
||||
|
@ -2,11 +2,13 @@
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="6"/>
|
||||
<Version Value="7"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<LRSInOutputDirectory Value="False"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<IconPath Value=".\"/>
|
||||
<TargetFileExt Value=".exe"/>
|
||||
</General>
|
||||
<VersionInfo>
|
||||
@ -34,7 +36,7 @@
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="5"/>
|
||||
<Version Value="8"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="lib_server.dll"/>
|
||||
@ -44,9 +46,6 @@
|
||||
<OtherUnitFiles Value="..\;..\..\;..\..\wst_rtti_filter\"/>
|
||||
<UnitOutputDirectory Value="obj"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<Generate Value="Faster"/>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<UseLineInfoUnit Value="False"/>
|
||||
|
@ -2,16 +2,16 @@
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="6"/>
|
||||
<Version Value="7"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<MainUnitHasUsesSectionForAllUnits Value="False"/>
|
||||
<MainUnitHasCreateFormStatements Value="False"/>
|
||||
<MainUnitHasTitleStatement Value="False"/>
|
||||
<LRSInOutputDirectory Value="False"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<IconPath Value=".\"/>
|
||||
<TargetFileExt Value=".exe"/>
|
||||
</General>
|
||||
<VersionInfo>
|
||||
@ -28,6 +28,11 @@
|
||||
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="1">
|
||||
<Item1>
|
||||
<PackageName Value="wst_indy"/>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="4">
|
||||
<Unit0>
|
||||
<Filename Value="tcp_server.pas"/>
|
||||
@ -52,7 +57,7 @@
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="5"/>
|
||||
<Version Value="8"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="tcp_server.exe"/>
|
||||
@ -69,10 +74,8 @@
|
||||
<UseAnsiStrings Value="True"/>
|
||||
</SyntaxOptions>
|
||||
</Parsing>
|
||||
<CodeGeneration>
|
||||
<Generate Value="Faster"/>
|
||||
</CodeGeneration>
|
||||
<Other>
|
||||
<CustomOptions Value="-dINDY_10"/>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
|
@ -27,7 +27,9 @@ uses
|
||||
base_service_intf, server_service_soap, server_service_json,
|
||||
base_binary_formatter, server_binary_formatter,
|
||||
metadata_service, metadata_service_imp, metadata_service_binder,
|
||||
server_listener , synapse_tcp_server,
|
||||
server_listener ,
|
||||
//synapse_tcp_server,
|
||||
indy_tcp_server,
|
||||
|
||||
user_service_intf, user_service_intf_binder, user_service_intf_imp , imp_helper,
|
||||
server_service_xmlrpc;
|
||||
@ -50,7 +52,8 @@ begin
|
||||
|
||||
WriteLn(Format('WST sample TCP Server listning on "%d"',[sSERVER_PORT]));
|
||||
WriteLn('Hit <enter> to stop.');
|
||||
listener := TwstSynapseTcpListener.Create();
|
||||
//listener := TwstSynapseTcpListener.Create();
|
||||
listener := TwstIndyTcpListener.Create();
|
||||
listener.Start();
|
||||
ReadLn;
|
||||
end.
|
||||
|
@ -28,6 +28,14 @@
|
||||
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="wst_synapse"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="wst_core"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="user_client_console.pas"/>
|
||||
@ -48,9 +56,14 @@
|
||||
<Filename Value="user_client_console.exe"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<OtherUnitFiles Value="..\;..\..\;$(LazarusDir)\others_package\synapse\;$(LazarusDir)\others_package\ics\latest_distr\Delphi\Vc32\;..\..\fcl-units\fcl-json\src\"/>
|
||||
<OtherUnitFiles Value="..\;..\..\;..\..\fcl-units\fcl-json\src\"/>
|
||||
<UnitOutputDirectory Value="obj"/>
|
||||
</SearchPaths>
|
||||
<Parsing>
|
||||
<SyntaxOptions>
|
||||
<CStyleOperator Value="False"/>
|
||||
</SyntaxOptions>
|
||||
</Parsing>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<GenerateDebugInfo Value="True"/>
|
||||
|
@ -6,6 +6,8 @@ uses
|
||||
Classes, SysUtils, TypInfo, {$IFDEF WINDOWS}ActiveX,{$ENDIF}
|
||||
user_service_intf_proxy,
|
||||
same_process_protocol, synapse_tcp_protocol, synapse_http_protocol, library_protocol,
|
||||
// same_process_protocol, indy_tcp_protocol, indy_http_protocol, library_protocol,
|
||||
// same_process_protocol, ics_tcp_protocol, ics_http_protocol, library_protocol,
|
||||
soap_formatter, binary_formatter, json_formatter,
|
||||
user_service_intf, xmlrpc_formatter, service_intf;
|
||||
|
||||
@ -89,8 +91,8 @@ begin
|
||||
usr.Category:= Normal;
|
||||
usr.eMail := ReadItem('Enter user e-mail : ',False);
|
||||
usr.Preferences := ReadItem('Enter user Preferences : ',False);
|
||||
buff := UpperCase(ReadItem('Do you want to add some notes : ',True));
|
||||
if ( buff[1] = 'O' ) then begin
|
||||
buff := UpperCase(ReadItem('Do you want to add some notes : ',False));
|
||||
if ( Length(buff) > 0 ) and ( buff[1] = 'Y' ) then begin
|
||||
usr.Note.Header := ReadItem('Enter user Note.Header : ',False);
|
||||
usr.Note.Author := ReadItem('Enter user Note.Author : ',False);
|
||||
usr.Note.Date := ReadItem('Enter user Note.Date : ',False);
|
||||
@ -234,6 +236,10 @@ begin
|
||||
{$IFEND}
|
||||
SYNAPSE_RegisterTCP_Transport();
|
||||
SYNAPSE_RegisterHTTP_Transport();
|
||||
// INDY_RegisterTCP_Transport();
|
||||
// INDY_RegisterHTTP_Transport();
|
||||
// ICS_RegisterTCP_Transport();
|
||||
// ICS_RegisterHTTP_Transport();
|
||||
LIB_Register_Transport();
|
||||
WriteLn('Sample Application using Web Services Toolkit');
|
||||
ReadFormatType();
|
||||
|
@ -2,7 +2,7 @@
|
||||
This unit has been produced by ws_helper.
|
||||
Input unit name : "user_service_intf".
|
||||
This unit name : "user_service_intf".
|
||||
Date : "29/12/2007 00:43:35".
|
||||
Date : "25/05/2009 01:53:09".
|
||||
}
|
||||
unit user_service_intf;
|
||||
{$IFDEF FPC}
|
||||
@ -108,7 +108,7 @@ end;
|
||||
|
||||
function TUserArray.GetItem(AIndex: Integer): TUser;
|
||||
begin
|
||||
Result := Inherited GetItem(AIndex) As TUser;
|
||||
Result := TUser(Inherited GetItem(AIndex));
|
||||
end;
|
||||
|
||||
class function TUserArray.GetItemClass(): TBaseRemotableClass;
|
||||
@ -278,12 +278,16 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
var
|
||||
typeRegistryIntance : TTypeRegistry = nil;
|
||||
initialization
|
||||
GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TUserCategory),'TUserCategory');
|
||||
GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TUser),'TUser');
|
||||
GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TNote),'TNote');
|
||||
GetTypeRegistry().Register(sNAME_SPACE,TypeInfo(TUserArray),'TUserArray');
|
||||
GetTypeRegistry().ItemByTypeInfo[TypeInfo(TUserArray)].RegisterExternalPropertyName(sARRAY_ITEM,'item');
|
||||
typeRegistryIntance := GetTypeRegistry();
|
||||
|
||||
typeRegistryIntance.Register(sNAME_SPACE,TypeInfo(TUserCategory),'TUserCategory');
|
||||
typeRegistryIntance.Register(sNAME_SPACE,TypeInfo(TUser),'TUser');
|
||||
typeRegistryIntance.Register(sNAME_SPACE,TypeInfo(TNote),'TNote');
|
||||
typeRegistryIntance.Register(sNAME_SPACE,TypeInfo(TUserArray),'TUserArray');
|
||||
typeRegistryIntance.ItemByTypeInfo[TypeInfo(TUserArray)].RegisterExternalPropertyName(sARRAY_ITEM,'item');
|
||||
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
This unit has been produced by ws_helper.
|
||||
Input unit name : "user_service_intf".
|
||||
This unit name : "user_service_intf_proxy".
|
||||
Date : "29/12/2007 00:43:35".
|
||||
Date : "25/05/2009 01:53:09".
|
||||
}
|
||||
|
||||
Unit user_service_intf_proxy;
|
||||
@ -32,15 +32,20 @@ Type
|
||||
):boolean;
|
||||
End;
|
||||
|
||||
Function wst_CreateInstance_UserService(const AFormat : string = 'SOAP:'; const ATransport : string = 'HTTP:'):UserService;
|
||||
Function wst_CreateInstance_UserService(const AFormat : string = 'SOAP:'; const ATransport : string = 'HTTP:'; const AAddress : string = ''):UserService;
|
||||
|
||||
Implementation
|
||||
uses wst_resources_imp, metadata_repository;
|
||||
|
||||
|
||||
Function wst_CreateInstance_UserService(const AFormat : string; const ATransport : string):UserService;
|
||||
Function wst_CreateInstance_UserService(const AFormat : string; const ATransport : string; const AAddress : string):UserService;
|
||||
Var
|
||||
locAdr : string;
|
||||
Begin
|
||||
Result := TUserService_Proxy.Create('UserService',AFormat+GetServiceDefaultFormatProperties(TypeInfo(UserService)),ATransport + 'address=' + GetServiceDefaultAddress(TypeInfo(UserService)));
|
||||
locAdr := AAddress;
|
||||
if ( locAdr = '' ) then
|
||||
locAdr := GetServiceDefaultAddress(TypeInfo(UserService));
|
||||
Result := TUserService_Proxy.Create('UserService',AFormat+GetServiceDefaultFormatProperties(TypeInfo(UserService)),ATransport + 'address=' + locAdr);
|
||||
End;
|
||||
|
||||
{ TUserService_Proxy implementation }
|
||||
@ -53,19 +58,21 @@ end;
|
||||
function TUserService_Proxy.GetList():TUserArray;
|
||||
Var
|
||||
locSerializer : IFormatterClient;
|
||||
strPrmName : string;
|
||||
locCallContext : ICallContext;
|
||||
locStrPrmName : string;
|
||||
Begin
|
||||
locCallContext := Self as ICallContext;
|
||||
locSerializer := GetSerializer();
|
||||
Try
|
||||
locSerializer.BeginCall('GetList', GetTarget(),(Self as ICallContext));
|
||||
locSerializer.BeginCall('GetList', GetTarget(),locCallContext);
|
||||
locSerializer.EndCall();
|
||||
|
||||
MakeCall();
|
||||
|
||||
locSerializer.BeginCallRead((Self as ICallContext));
|
||||
locSerializer.BeginCallRead(locCallContext);
|
||||
TObject(Result) := Nil;
|
||||
strPrmName := 'result';
|
||||
locSerializer.Get(TypeInfo(TUserArray), strPrmName, Result);
|
||||
locStrPrmName := 'result';
|
||||
locSerializer.Get(TypeInfo(TUserArray), locStrPrmName, Result);
|
||||
|
||||
Finally
|
||||
locSerializer.Clear();
|
||||
@ -77,17 +84,19 @@ procedure TUserService_Proxy.Add(
|
||||
);
|
||||
Var
|
||||
locSerializer : IFormatterClient;
|
||||
strPrmName : string;
|
||||
locCallContext : ICallContext;
|
||||
locStrPrmName : string;
|
||||
Begin
|
||||
locCallContext := Self as ICallContext;
|
||||
locSerializer := GetSerializer();
|
||||
Try
|
||||
locSerializer.BeginCall('Add', GetTarget(),(Self as ICallContext));
|
||||
locSerializer.BeginCall('Add', GetTarget(),locCallContext);
|
||||
locSerializer.Put('AUser', TypeInfo(TUser), AUser);
|
||||
locSerializer.EndCall();
|
||||
|
||||
MakeCall();
|
||||
|
||||
locSerializer.BeginCallRead((Self as ICallContext));
|
||||
locSerializer.BeginCallRead(locCallContext);
|
||||
|
||||
Finally
|
||||
locSerializer.Clear();
|
||||
@ -99,17 +108,19 @@ procedure TUserService_Proxy.Update(
|
||||
);
|
||||
Var
|
||||
locSerializer : IFormatterClient;
|
||||
strPrmName : string;
|
||||
locCallContext : ICallContext;
|
||||
locStrPrmName : string;
|
||||
Begin
|
||||
locCallContext := Self as ICallContext;
|
||||
locSerializer := GetSerializer();
|
||||
Try
|
||||
locSerializer.BeginCall('Update', GetTarget(),(Self as ICallContext));
|
||||
locSerializer.BeginCall('Update', GetTarget(),locCallContext);
|
||||
locSerializer.Put('AUser', TypeInfo(TUser), AUser);
|
||||
locSerializer.EndCall();
|
||||
|
||||
MakeCall();
|
||||
|
||||
locSerializer.BeginCallRead((Self as ICallContext));
|
||||
locSerializer.BeginCallRead(locCallContext);
|
||||
|
||||
Finally
|
||||
locSerializer.Clear();
|
||||
@ -121,20 +132,22 @@ function TUserService_Proxy.Find(
|
||||
):TUser;
|
||||
Var
|
||||
locSerializer : IFormatterClient;
|
||||
strPrmName : string;
|
||||
locCallContext : ICallContext;
|
||||
locStrPrmName : string;
|
||||
Begin
|
||||
locCallContext := Self as ICallContext;
|
||||
locSerializer := GetSerializer();
|
||||
Try
|
||||
locSerializer.BeginCall('Find', GetTarget(),(Self as ICallContext));
|
||||
locSerializer.BeginCall('Find', GetTarget(),locCallContext);
|
||||
locSerializer.Put('AName', TypeInfo(string), AName);
|
||||
locSerializer.EndCall();
|
||||
|
||||
MakeCall();
|
||||
|
||||
locSerializer.BeginCallRead((Self as ICallContext));
|
||||
locSerializer.BeginCallRead(locCallContext);
|
||||
TObject(Result) := Nil;
|
||||
strPrmName := 'result';
|
||||
locSerializer.Get(TypeInfo(TUser), strPrmName, Result);
|
||||
locStrPrmName := 'result';
|
||||
locSerializer.Get(TypeInfo(TUser), locStrPrmName, Result);
|
||||
|
||||
Finally
|
||||
locSerializer.Clear();
|
||||
@ -146,19 +159,21 @@ function TUserService_Proxy.Delete(
|
||||
):boolean;
|
||||
Var
|
||||
locSerializer : IFormatterClient;
|
||||
strPrmName : string;
|
||||
locCallContext : ICallContext;
|
||||
locStrPrmName : string;
|
||||
Begin
|
||||
locCallContext := Self as ICallContext;
|
||||
locSerializer := GetSerializer();
|
||||
Try
|
||||
locSerializer.BeginCall('Delete', GetTarget(),(Self as ICallContext));
|
||||
locSerializer.BeginCall('Delete', GetTarget(),locCallContext);
|
||||
locSerializer.Put('AName', TypeInfo(string), AName);
|
||||
locSerializer.EndCall();
|
||||
|
||||
MakeCall();
|
||||
|
||||
locSerializer.BeginCallRead((Self as ICallContext));
|
||||
strPrmName := 'result';
|
||||
locSerializer.Get(TypeInfo(boolean), strPrmName, Result);
|
||||
locSerializer.BeginCallRead(locCallContext);
|
||||
locStrPrmName := 'result';
|
||||
locSerializer.Get(TypeInfo(boolean), locStrPrmName, Result);
|
||||
|
||||
Finally
|
||||
locSerializer.Clear();
|
||||
|
@ -124,7 +124,7 @@ begin
|
||||
wrtr.WriteAnsiStr(Self.Format);
|
||||
SetLength(binBuff,ARequest.Size);
|
||||
ARequest.Position := 0;
|
||||
ARequest.Read(binBuff[1],Length(binBuff));
|
||||
ARequest.Read(binBuff[0],Length(binBuff));
|
||||
wrtr.WriteBinary(binBuff);
|
||||
buffStream.Position := 0;
|
||||
wrtr.WriteInt32S(buffStream.Size-4);
|
||||
@ -146,9 +146,9 @@ begin
|
||||
i := bufferLen;
|
||||
SetLength(binBuff,i);
|
||||
repeat
|
||||
j := FConnection.RecvBufferEx(@(binBuff[1]),i,DefaultTimeOut);
|
||||
j := FConnection.RecvBufferEx(@(binBuff[0]),i,DefaultTimeOut);
|
||||
FConnection.ExceptCheck();
|
||||
AResponse.Write(binBuff[1],j);
|
||||
AResponse.Write(binBuff[0],j);
|
||||
Inc(c,j);
|
||||
i := Min(1024,(bufferLen-c));
|
||||
until ( i =0 ) or ( j <= 0 );
|
||||
|
@ -121,9 +121,9 @@ begin
|
||||
i := bufferLen;
|
||||
SetLength(binBuff,i);
|
||||
repeat
|
||||
j := FSocketObject.RecvBufferEx(@(binBuff[1]),i,DefaultTimeOut);
|
||||
j := FSocketObject.RecvBufferEx(@(binBuff[0]),i,DefaultTimeOut);
|
||||
FSocketObject.ExceptCheck();
|
||||
FInputStream.Write(binBuff[1],j);
|
||||
FInputStream.Write(binBuff[0],j);
|
||||
Inc(c,j);
|
||||
if ( ( bufferLen - c ) > 1024 ) then
|
||||
i := 1024
|
||||
@ -200,7 +200,7 @@ begin
|
||||
buff := rdr.ReadBinary();
|
||||
rdr := nil;
|
||||
FInputStream.Size := 0;
|
||||
FInputStream.Write(buff[1],Length(buff));
|
||||
FInputStream.Write(buff[0],Length(buff));
|
||||
SetLength(buff,0);
|
||||
FInputStream.Position := 0;
|
||||
rqst := TRequestBuffer.Create(trgt,ctntyp,FInputStream,FOutputStream,frmt);
|
||||
@ -210,7 +210,7 @@ begin
|
||||
i := FOutputStream.Size;
|
||||
SetLength(buff,i);
|
||||
FOutputStream.Position := 0;
|
||||
FOutputStream.Read(buff[1],i);
|
||||
FOutputStream.Read(buff[0],i);
|
||||
FOutputStream.Size := 0;
|
||||
wrtr := CreateBinaryWriter(FOutputStream);
|
||||
wrtr.WriteBinary(buff);
|
||||
|
Reference in New Issue
Block a user