Version: current

# Class SocketWriteRead

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.

Package: cms\comments
Copyright: Alex Potsides, http://www.achingbrain.net
License: GNU General Public License
Author: Alex Potsides
Version: 0.1
Link: http://www.achingbrain.net/
Located at cms/code/sitefeatures/Akismet.php

## Methods summary

`public` | # `__construct( string $host, integer $port, string $request, integer $responseLength = 1160 )` #### Parameters $host string $host The host to send/receive data. $port int $port The port on the remote host. $request string $request The data to send. $responseLength int $responseLength The amount of data to read. Defaults to 1160 bytes.
`public` | # `send( )` Sends the data to the remote host. Sends the data to the remote host. #### Throws `An` exception is thrown if a connection cannot be made to the remote host.
`public string` | # `getResponse( )` Returns the server response text Returns the server response text #### Returns `string` string
`public integer` | # `getErrorNumner( )` Returns the error number Returns the error number If there was no error, 0 will be returned. #### Returns `integer` int
`public string` | # `getErrorString( )` Returns the error string Returns the error string If there was no error, an empty string will be returned. #### Returns `string` string

### Magic methods summary

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -