PEAR Manual
This manual is provided as a courtesy. It is not an official source. Please check pear.php.net for updated information.
require_once 'Net/NNTP.php';
boolean Net_NNTP::prepareConnection (string $nntpserver [, integer $port = 119, integer $newsgroup [, integer $user = NULL [, integer $pass = NULL, integer [$authmode = PEAR_NNTP_ORIGINAL]]]])
boolean Net_NNTP::prepareConnection
Connect to a specific newsserver and access the given newsgroup
This function is deprecated. That means that future versions of this package may not support it anymore.
Consider this method deprecated - use Net_NNTP::connectAuthenticated() instead.
$nntpserver - Name of the newsserver to connect
$port - Port, where the newsserver listens
$newsgroup - Newsgroup to access
$user - Username to authenticate
$pass - Password to authenticate
$authmode - Type of authentication, at the moment only PEAR_NNTP_AUTHORIGINAL
boolean - TRUE if successful
Table 47-1. Possible PEAR_Error values
wrong server name or adress
the host itself isn't link to a network
a firewall doesn't allow an access
This function can not be called statically.
Fetching data with a connection created with prepareConnection() is faster then a created connection with connect()
Net_NNTP::quit(), Net_NNTP::connect()
Example 47-1. Using prepareConnection()
require_once "Net/NNTP.php"; $nntp = new Net_NNTP; $ret = $nntp->connect("news.php.net", 119, "php.pear.dev"); if( PEAR::isError($ret)) { // handle error } else { // success }