Here is my code :
Code: Select all
startCase(Action) :-
Action = 2,
try
ResultStream = outputStream_String::new(),
Connection = vPcURL::new(ResultStream, caseCompletion, Action),
_ = Connection:curl_easy_setopt(cURLOPT_USERPWD, s("my_email@my_domain.com:my_password")),
_ = Connection:curl_easy_setopt(cURLOPT_URL, s("pop3://my_pop3_domain.com")),
_ = Connection:curl_easy_perform()
catch _ do
taskWindow::ecri_log(string::format("startCase % pas ok.", Action)),
succeed()
end try.
Code: Select all
caseCompletion(cURLE_OK, 2, Connection) :-
ResultStreamS = uncheckedConvert(outputstream_string, Connection:getOutputStream()),
Received = ResultStreamS:getString(),
ResultStreamS:close(),
Received8 = uncheckedConvert(string8, Received),
Reponse = string8::mapToString(Received8),
Connection:curl_easy_cleanup(),
setCaseIdle(2),
stdio::write(Reponse),stdio::nl,
!.