Class SocketWriteRead

Description

Utility class used by Akismet

This class is used by Akismet to do the actual sending and receiving of data. It opens a connection to a remote host, sends some data and the reads the response and makes it available to the calling program.

The code that makes up this class originates in the Akismet WordPress plugin, which is available on the Akismet website.

N.B. It is not necessary to call this class directly to use the Akismet class. This is included here mainly out of a sense of completeness.

Located in /Akismet.class.php (line 311)


	
			
Method Summary
SocketWriteRead __construct (string $host, int $port, string $request, [int $responseLength = 1160])
string getErrorString ()
string getResponse ()
void send ()
Methods
Constructor __construct (line 326)
  • access: public
SocketWriteRead __construct (string $host, int $port, string $request, [int $responseLength = 1160])
  • string $host: The host to send/receive data.
  • int $port: The port on the remote host.
  • string $request: The data to send.
  • int $responseLength: The amount of data to read. Defaults to 1160 bytes.
getErrorNumner (line 376)

Returns the error number

If there was no error, 0 will be returned.

  • access: public
int getErrorNumner ()
getErrorString (line 387)

Returns the error string

If there was no error, an empty string will be returned.

  • access: public
string getErrorString ()
getResponse (line 365)

Returns the server response text

  • access: public
string getResponse ()
send (line 340)

Sends the data to the remote host.

  • throws: An exception is thrown if a connection cannot be made to the remote host.
  • access: public
void send ()

Documentation generated on Sat, 23 Feb 2008 11:03:15 +0000 by phpDocumentor 1.4.1