| core_net

# Class: Bs_NetApplication Source Location: /core/net/Bs_NetApplication.class.php
### Class Overview
    Bs_Object
       |
       --Bs_NetApplication
Helper Class for net applications which may extend this one. #### Author(s): Andrej Arn <at blueshoes dot org> #### Version: 4.3.$Revision: 1.2 $ $Date: 2003/10/29 17:48:41 $ #### Copyright: blueshoes.org | ### Variables $Bs_Url $host $port | ### Methods Bs_NetApplication connect disconnect _raiseError
### Child classes: Bs_Whois Whois class. Bs_EmailValidator Validates email addresses. Bs_Smtp SMTP class. Bs_HttpClient Can grab a website from the internet. | ### Inherited Variables | ### Inherited Methods #### Class: Bs_Object Bs_Object::Bs_Object() Bs_Object::getErrors() Basic error handling: Get *all* errors as string array from the global Bs_Error-error stack. Bs_Object::getLastError() Basic error handling: Get last error string from the global Bs_Error-error stack. Bs_Object::getLastErrors() Basic error handling: Get last errors string array from the global Bs_Error-error stack sinc last call of getLastErrors(). Bs_Object::persist() Persists this object by serializing it and saving it to a file with unique name. Bs_Object::setError() Basic error handling: Push an error string on the global Bs_Error-error stack. Bs_Object::toHtml() Dumps the content of this object to a string using PHP's var_dump(). Bs_Object::toString() Dumps the content of this object to a string using PHP's var_dump(). Bs_Object::unpersist() Fetches an object that was persisted with persist()
### Class Details [line 23] Helper Class for net applications which may extend this one. It offers 2 Bs_SocketClients, the main one and a temporary one, plus the connect() and disconnect() methods. (see var $this->_Bs_SocketClient_Temp) dependencies: Net/Bs_SocketClient, Net/Bs_Url #### Tags:
todo: | maybe replace the 2 Bs_SocketClients with an array of 10? was a sugguestion from sam.
version: | 4.3.$Revision: 1.2 $ $Date: 2003/10/29 17:48:41 $
copyright: | blueshoes.org
author: | Andrej Arn <at blueshoes dot org>
[ Top ] ### Class Variables #### $Bs_Url = [line 31] actually now i don't see why this is needed here. afaisee it's not even in use in this file. --andrej 2001/09/06 #### Tags:
access: | public
Type: | object
[ Top ] #### $host = NULL [line 75] the host we work on, eg 'your.server.com' or '111.111.111.111'. #### Tags:
access: | public
Type: | string
[ Top ] #### $port = NULL [line 83] the port we send to. expected to be overwritten. #### Tags:
access: | public
Type: | int
[ Top ] ### Class Methods ### constructor Bs_NetApplication [line 86]
`Bs_NetApplication Bs_NetApplication( )`
[ Top ] ### method connect [line 106]
`bool connect( string $host, [int $port = NULL], [bool $persistent = FALSE], [int $timeOut = NULL], [bool $blocking = TRUE])`
Make the connection. this method updates the object vars $host and $port. #### Tags:
return: | true on success, on failure see throw
throws: | bs_exception
access: | public
Overridden in child classes as: Bs_EmailValidator::connect() Overwrites the parent method, but still makes use of it. #### Parameters:
string | $host | like 'your.server.com' or an ip address like '111.111.111.111'.
int | $port | the tcp port number.
bool | $persistent | default is FALSE.
int | $timeOut | for temp conn default is 0, for main conn it's 30.
bool | $blocking | default is TRUE, see Bs_SocketClient->setBlocking().
[ Top ] ### method disconnect [line 138]
`void disconnect( )`
Close the connection if it was open. #### Tags:
access: | public
Overridden in child classes as: Bs_EmailValidator::disconnect() Overwrites the parent method, but still makes use of it. [ Top ] ### method _raiseError [line 150]
`void _raiseError( )`
you have to overwrite this method. [ Top ] Documentation generated on Mon, 29 Dec 2003 21:12:05 +0100 by phpDocumentor 1.2.3