Client-Side Example
Below is a small code example of creating an AstaConnection and connecting to a remote ASTA SkyWire™ server just to see if it is available. Note the UserName and Password is being set.
Var Conversation : Pointer;
OK, BoolRes: boolean;
begin
OK := false;
AstaConnCreate(RefLib, Conversation);
AstaConnSetTimeout(RefLib, Conversation, 1000);
AstaConnSetAuthorizationOn(RefLib, Conversation,
'Asta', 'Password', False);
AstaConnOpen(RefLib, Conversation, Connection.IPAddr,
Connection.Port, BoolRes);
// try the server and see if it is available
if BoolRes then
begin
AstaConnClose(RefLib, Conversation, BoolRes);
Ok := true;
end;
. . .
end;
|
|