Code: Select all
#include "/home/user/harbour/contrib/hbcurl/hbcurl.ch"
function Main()
local n
for n = 1 to 10
hb_threadStart( @ReadWeb() )
next
hb_threadWaitForAll()
InKey( 1 )
return nil
function ReadWeb()
local hCurl, cBuffer := ""
local cUrl := "http://www.modharbour.org/modharbour_samples/info.prg"
curl_global_init()
if ! empty( hCurl := curl_easy_init() )
curl_easy_setopt( hCurl, HB_CURLOPT_URL, cUrl )
curl_easy_setopt( hCurl, HB_CURLOPT_DL_BUFF_SETUP )
if curl_easy_perform( hCurl ) == 0
uValue = curl_easy_dl_buff_get( hCurl )
? 'Thread: ', hb_threadId(), 'Get: ', Len( uValue )
endif
endif
curl_global_cleanup()
return nil