class PPOP3 |
A TCP/IP socket for the Post Office Protocol version 3.
![]() | ParseResponse ( const PString & line ) Parse a response line string into a response code and any extra info on the line. |
Construction
Overrides from class PObject
Overrides from class PChannel
Channel establish functions
Information functions
Reading functions
Writing functions
Miscellaneous functions
Error functions
Run Time Type functions
I/O functions
Comparison functions
A TCP/IP socket for the Post Office Protocol version 3.When acting as a client, the procedure is to make the connection to a remote server, then to retrieve a message using the following procedure: <PRE><CODE> PPOP3Client mail("popserver"); if (mail.IsOpen()) { if (mail.LogIn("Me", "password")) { if (mail.GetMessageCount() > 0) { PUnsignedArray sizes = mail.GetMessageSizes(); for (PINDEX i = 0; i < sizes.GetSize(); i++) { if (mail.BeginMessage(i+1)) mail.Read(myMessage, sizes[i]); else PError << "Error getting mail message." << endl; } } else PError << "No mail messages." << endl; } else PError << "Mail log in failed." << endl; } else PError << "Mail conection failed." << endl; </PRE></CODE>
When acting as a server, a descendant class would be created to override at least the <A>HandleOpenMailbox()</A>, <A>HandleSendMessage()</A> and <A>HandleDeleteMessage()</A> functions. Other functions may be overridden for further enhancement to the sockets capabilities, but these will give a basic POP3 server functionality.
The server socket thread would continuously call the <A>ProcessMessage()</A> function until it returns FALSE. This will then call the appropriate virtual function on parsing the POP3 protocol.
The default bahaviour looks for a space or a '-' and splits the code and info either side of that character, then returns FALSE.
Alphabetic index HTML hierarchy of classes or Java