[Gambas-devel] [RFC] Gambas implementation of the pop3 protocol

Benoît Minisini gambas at ...1...
Sat Aug 25 00:44:08 CEST 2012


Le 24/08/2012 05:39, Sebastian Kulesz a écrit :
> Hi! I made a component to implement the pop3 protocol purely in Gambas
> and wanted some feedback on how the API should be implemented.
>
> Right now there is an exported class called Pop3Client that wraps the
> call depending if the connection should be encrypted or not using 2
> sub classes (TCPClient & SSLClient) which share the same API. If it is
> encrypted, an openssl process is used to execute the commands and read
> the response, if it's not, a plain socket is used.
>
> At first i wanted to include asynchronous support, but it was REALLY
> buggy and difficult to implement, so i left it synchronous. A list of
> the implemented commands can be found at the top of the
> Pop3Client.class file. Although the user can use the Pop3Client.Send()
> call directly to send any command, their implementation should return
> the data on a semi parsed form
>
> I'm not sure how the API should be implemented and if the structure
> i'm using is the best approach. How would you implement the protocol?
> How would you abstract encrypted and non encrypted connections so that
> the difference cannot be seen by the developer?
> When executing a command that requires a large amount of data to be
> downloaded (e.g retrieve a message with attachments), subsequent calls
> can be overlapped, is there a way to avoid this?
>
> * Protocol specifications: http://tools.ietf.org/html/rfc1939
>
> Thanks a lot!!
>

I will look at it.

Check if the new gb.task component could allow you to implement an 
asynchronous version of the Pop3Client (like FtpClient and HttpClient).

SmtpClient handle encrypted connections the same way as you. Maybe you 
can look at its code?

Now we will need a MIME library to parse MIME messages...

Regards,

-- 
Benoît Minisini




More information about the Devel mailing list