Connection::NNTP - Zero Knowledge Network News Transport Protocol
use Connection::NNTP;
$nntp = new Connection::NNTP(); $nntp = new Connection::NNTP( User => $user );
Perl5.004+ Net::NNTP User::Base (Subclass)
Nothing
This is the NNTP protocol encapsulation class. This class implements a client interface to the NNTP protocol enabling perl applications to talk to NNTP servers. This implementation assumes that you are familiar with the concepts of the NNTP protocol described in RFC977.
The Connection::NNTP object must be created with the new method. Once this has been done, all NNTP commands are accessed through this object.
The Connection::NNTP class is subclass of Connection::Base.
#!/usr/bin/perl C<-w>
use User::Net; use Message::NewsMessage; use Connection::NNTP;
$user = new User::Net(); $message = new Message::NewsMessage();
$nntp = new Connection::NNTP();
$nntp->connect( $user ); $nntp->post( $message ); $nntp->quit();
This is the constructor for the Connection::NNTP object. USER
is the user for authentication to the server. The USER
parameter is a sub-class of the User::Base class hiearchy and is optional.
Constructor options must be passed in a hash-like fashion, using key and value pairs.
Example:
$nntp = new Connection::NNTP( User => $server );
Open the connection to the remote NNTP server. If USER
was not specified at object creation, then it MUST be provided for successful connection to the remote server. USER
is one of the sub-classes of the User::Base
class hierachy.
Return the user object associated with this NNTP server connection. If USER is supplied, then it wil be used for future connections, but will not affect the current news server connection.
Post a new message to the news server. The MESSAGE parameter is of type Message::MailMessage.
Grab the next message from the news server. If the current message is the
first message in the group, then it will be returned and the internal
message pointer will be moved to the next waiting message. If the current
message is the last message in the group then
undef
will be returned.
Grab the previous message from the news server. If the current message is
the last message in the group then it willbe returned and the internal
message pointer will be moved to the previous message. If the current
message is the first message in the group, then undef
willbe returned.
Grab a list of the message headers from the news server. If the group is
contains no messages then undef
will be returned.
Grab a list of the message from the news server. The messages returned will
be of the type Message::NewsMessage. If the group is empty, then undef
willbe returned.
Set the current (active) newsgroup to GROUP
. This method will in effect set the active group to the name specified and
reset the internal message pointer to the first message in the group.
Close the connection to remote NNTP server.
None Present
Net::NNTP, Connection::Base, User::Net, User::Nym, Message::NewsMessage
Kris Smith <krissmi@zeroknowledge.com> Philippe McLean <phillipem@zeroknowledge.com>
Copyright 2000 Zero Knowledge Systems, Inc. All rights reserved