Curl wrapper round two

Jimmy Cao jcao219 at gmail.com
Sun Jun 19 14:38:48 PDT 2011


On Sun, Jun 19, 2011 at 3:03 PM, jdrewsen <jdrewsen at nospam.com> wrote:

> Den 19-06-2011 17:57, Jimmy Cao skrev:
>
>> On Sun, Jun 19, 2011 at 5:29 AM, jdrewsen <jdrewsen at nospam.com
>>
>> <mailto:jdrewsen at nospam.com>> wrote:
>>
>>    Very nice. A couple of things I believe would help:
>>    1, Get rid of MailMessageData and use curl.onSend() and a delegate
>>    that keeps a reference to the message. That way you don't have to
>>    use the lower level Curl.set(infile/readfunction) calls as well.
>>
>>
>> Ah, that makes it much better.
>>
>>    2, It would be nice if the static sendMail(...) function worked like
>>    the Http/Ftp counterparts. They return a Result object that you can
>>    change before performing the actual task. That way you can easily
>>    set timeouts etc. If there shouldn't be support for async smtp then
>>    this is probably not important though.
>>
>>
>> There should be support for async SMTP.
>> The problem is this:
>> SMTP.sendMailAsync(...).**connectTimeout(dur!"seconds"(**
>> 60)).localPort(25).?
>>
>> byLine, byChunk, etc don't make much sense there.
>>
>> I think it would be better to get rid of the static sendMail function,
>> and write a performAsync method.
>> I'm not sure though.
>> Something like this:
>> https://gist.github.com/**1034433 <https://gist.github.com/1034433>
>>
>
> Maybe i doesn't make sense to provide the async interface at all? Users
> needing to do it async could just as well create a delegate and call spawn
> themselves.
>
> /Jonas
>

Yep.
I think there isn't a need for a static convenience function either.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20110619/2f6c2ae6/attachment.html>


More information about the Digitalmars-d mailing list