Lines Matching refs:this

72         $this->connectionString = $connectionString;
75 $this->validateTimeout($connectionTimeout);
78 $this->connectionTimeout = $connectionTimeout ?? (float) ini_get('default_socket_timeout');
79 $this->persistent = $persistent;
80 $this->validateTimeout($timeout);
81 $this->timeout = $timeout;
82 $this->validateTimeout($writingTimeout);
83 $this->writingTimeout = $writingTimeout;
84 $this->chunkSize = $chunkSize;
97 $this->connectIfNotConnected();
98 $data = $this->generateDataStream($record);
99 $this->writeToSocket($data);
107 if (!$this->isPersistent()) {
108 $this->closeSocket();
117 if (is_resource($this->resource)) {
118 fclose($this->resource);
119 $this->resource = null;
128 $this->persistent = $persistent;
130 return $this;
140 $this->validateTimeout($seconds);
141 $this->connectionTimeout = $seconds;
143 return $this;
153 $this->validateTimeout($seconds);
154 $this->timeout = $seconds;
156 return $this;
166 $this->validateTimeout($seconds);
167 $this->writingTimeout = $seconds;
169 return $this;
177 $this->chunkSize = $bytes;
179 return $this;
187 return $this->connectionString;
195 return $this->persistent;
203 return $this->connectionTimeout;
211 return $this->timeout;
221 return $this->writingTimeout;
229 return $this->chunkSize;
239 return is_resource($this->resource)
240 && !feof($this->resource); // on TCP - other party can close connection.
250 …return @pfsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTime…
260 …return @fsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeo…
272 $seconds = floor($this->timeout);
273 $microseconds = round(($this->timeout - $seconds) * 1e6);
275 if (!is_resource($this->resource)) {
279 return stream_set_timeout($this->resource, (int) $seconds, (int) $microseconds);
291 if (!is_resource($this->resource)) {
295 if (null === $this->chunkSize) {
299 return stream_set_chunk_size($this->resource, $this->chunkSize);
309 if (!is_resource($this->resource)) {
313 return @fwrite($this->resource, $data);
323 if (!is_resource($this->resource)) {
327 return stream_get_meta_data($this->resource);
339 if ($this->isConnected()) {
342 $this->connect();
358 return $this->resource;
363 $this->createSocketResource();
364 $this->setSocketTimeout();
365 $this->setStreamChunkSize();
370 if ($this->isPersistent()) {
371 $resource = $this->pfsockopen();
373 $resource = $this->fsockopen();
376 …w new \UnexpectedValueException("Failed connecting to $this->connectionString ($this->errno: $this
378 $this->resource = $resource;
383 if (!$this->streamSetTimeout()) {
390 if ($this->chunkSize && !$this->streamSetChunkSize()) {
399 $this->lastSentBytes = $sent;
400 while ($this->isConnected() && $sent < $length) {
402 $chunk = $this->fwrite($data);
404 $chunk = $this->fwrite(substr($data, $sent));
410 $socketInfo = $this->streamGetMetadata();
415 if ($this->writingIsTimedOut($sent)) {
416 …throw new \RuntimeException("Write timed-out, no data sent for `{$this->writingTimeout}` seconds, …
419 if (!$this->isConnected() && $sent < $length) {
427 if (0.0 == $this->writingTimeout) {
431 if ($sent !== $this->lastSentBytes) {
432 $this->lastWritingAt = microtime(true);
433 $this->lastSentBytes = $sent;
440 if ((microtime(true) - $this->lastWritingAt) >= $this->writingTimeout) {
441 $this->closeSocket();