A sockets based (streamsocketclient) adapter class for ZendHttpClient. Can be used on almost every PHP environment, and does not require any special extensions.
Adapter constructor, currently empty. Config is set using setOptions()
Set the configuration array for the adapter
| Parameters: | array|Traversable – |
|---|---|
| Throws AdapterExceptionInvalidArgumentException: | |
Set the stream context for the TCP connection to the server
Can accept either a pre-existing stream context resource, or an array of stream options, similar to the options array passed to the stream_context_create() PHP function. In such case a new stream context will be created using the passed options.
| Parameters: | mixed – Stream context or array of context options |
|---|---|
| Throws ExceptionInvalidArgumentException: | |
| Return type: | Socket |
Get the stream context for the TCP connection to the server.
If no stream context is set, will create a default one.
| Return type: | resource |
|---|
Connect to the remote server
| Parameters: |
|
|---|---|
| Throws AdapterExceptionRuntimeException: | |
Send request to the remote server
| Parameters: |
|
|---|---|
| Throws AdapterExceptionRuntimeException: | |
| Return type: | string Request as string |
Read response from server
| Return type: | string |
|---|
Close the connection to the server
Check if the socket has timed out - if so close connection and throw an exception