Difference between revisions of "Midware TAppSrvClient.OnRequestDone"

From Overbyte
Jump to navigation Jump to search
(Created page with ' Main page -> Midware component reference -> TAppSrvClient -> [[Midware_TAppSrvClient.OnRequestDone | …')
 
 
(2 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
== Definition ==
 
== Definition ==
  
'''property''' OnRequestDone: '''TRequestDone''';
+
<syntaxhighlight lang="delphi">
 +
type
 +
TRequestDone = procedure (Sender : TObject; Error : Integer) of object;
 +
 
 +
property OnRequestDone : TRequestDone;
 +
</syntaxhighlight>
  
 
== Description ==
 
== Description ==
Line 14: Line 19:
  
 
Most common errors are:
 
Most common errors are:
10061: Connection refused. Probably server do not run, or server IP address or port number is wrong.
+
 
 +
10061:Connection refused. Probably server do not run, or server IP address or port number is wrong.
  
 
10065: Host unreachable. Probably TCP/IP setup incorrectly done.
 
10065: Host unreachable. Probably TCP/IP setup incorrectly done.
 +
 
10053, 10054, 10057: Connection error. Probably phone hangup, carrier lost, cable broken, server hung and all such failures.
 
10053, 10054, 10057: Connection error. Probably phone hangup, carrier lost, cable broken, server hung and all such failures.
 
TRequestDone = procedure (Sender : TObject; Error : Integer) of object;
 

Latest revision as of 10:03, 14 May 2011

Main page -> Midware component reference -> TAppSrvClient -> OnRequestDone

Definition

<syntaxhighlight lang="delphi"> type TRequestDone = procedure (Sender : TObject; Error : Integer) of object;

property OnRequestDone : TRequestDone; </syntaxhighlight>

Description

Occurs when a request has been statisfied and result set is available.

When the application server sent the answer to the client, the OnRequestdone event is triggered. The corresponding event handler is the right place to test for success or failure, and to parse the answer to extract the returned info to update the user interface or do whatever needs to be done with the request's result. See sample code. It is also the right place to close communication using Close methods.

There are two levels of errors: at client side and at server side. The argument Error gives an error code related to client side, AnswerStatus gives an error code of phrase related to server side. Values for the Error argument may be any operating system error code, more specifically winsock errors (in the range 10000 to 12000). See windows documentation for error list.

Most common errors are:

10061:Connection refused. Probably server do not run, or server IP address or port number is wrong.

10065: Host unreachable. Probably TCP/IP setup incorrectly done.

10053, 10054, 10057: Connection error. Probably phone hangup, carrier lost, cable broken, server hung and all such failures.