TAstaClientSocket.SendAndBlock
Applies to
TAstaClientSocket
Declaration
function
SendAndBlock(TimeOut : Integer):String;
Description
The AstaClientSocket are by non-blocking event driven sockets. There are times however when you require blocking calls like within Isapi DLL's where is now windows message pump. In those situations you can use the SendAndBlock method after first setting the ClientType to ctblocking. This allows you to make any number of AstaclientDataSet calls and they will be cached until you cal the SendAndBlock method. Any errors will be returned in the String function result. To open a single AstaClientDataSet with a blocking call use AstaclientDataSet1.OpenWithBlockingSocket(500,True). ASTA uses tcp/ip by default but can also run stateless using HTTP to defeat firewalls if necessary.
var
Error:String;
begin
AstaclientSocket1.Clienttype:=ctblocking;
AstaClientDataSet1.Open;
AstaclientDataSet2.Open;
Error:=AstaclientSocket1.SendAndBlock(1000);
AstaClientDataSet1.SuitCaseData.Active:=True;
AstaclientDataSet2.SuitCaseData.Active:=True;
AstaClientDataSet1.Open;
AstaclientDataSet2.Open;