Name
SetStatusCallback
Synopsis
$inet
->SetStatusCallback( )
Initializes the callback routine used to return data about the progress of an asynchronous operation. This is one of the steps required to perform asynchronous operations; the complete procedure is:
# Use the INTERNET_FLAG_ASYNC when initializing $params{'flags'}=INTERNET_FLAG_ASYNC; $inet = new Win32::Internet(params); # Initialize the callback routine $inet->SetStatusCallback( ); # Specify the context parameter (the last 1 in this case) $inet->HTTP($http, "www.yahoo.com", "anonymous", "dada\@divinf.it", 80, 0, 1);
At this point, control returns immediately to Perl, and
$inet->Error( )
will
return 997
, which means an
asynchronous I/O operation is pending. Now, you can call:
$http->GetStatusCallback(1);
in a loop to verify what’s happening; see also GetStatusCallback
.
Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.