Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function __construct(Options $options)
- {
- $this->responseBuffer = new Response();
- $this->connection = stream_socket_client($options->fullSocketAddress());
- if (!$this->isAlive($this->connection)) {
- throw new DeadSocket();
- }
- stream_set_timeout($this->connection, $this->timeout);
- $this->options = $options;
- }
- public function send(string $xml)
- {
- try {
- fwrite($this->connection, $xml);
- } catch (Exception $e) {
- $this->options->getLogger()->error(__METHOD__ . '::' . __LINE__ . " fwrite() failed " . $e->getMessage());
- return;
- }
- }
- if (!is_resource($this->connection)) $this->reconnect();
- if (!$this->connection) $this->reconnect();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement