Skip to content

Commit

Permalink
Further update API docs, remove unneeded code
Browse files Browse the repository at this point in the history
  • Loading branch information
cboden committed Oct 12, 2017
1 parent 2dc9a6d commit d2c3e06
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/WebSocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace Ratchet\Client;
use Evenement\EventEmitterTrait;
use Evenement\EventEmitterInterface;
use React\Stream\DuplexStreamInterface;
use React\Socket\ConnectionInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Ratchet\RFC6455\Messaging\MessageBuffer;
Expand All @@ -27,7 +27,7 @@ class WebSocket implements EventEmitterInterface {
public $response;

/**
* @var \React\Stream\DuplexStreamInterface
* @var \React\Socket\ConnectionInterface
*/
protected $_stream;

Expand All @@ -38,15 +38,15 @@ class WebSocket implements EventEmitterInterface {

/**
* WebSocket constructor.
* @param \React\Stream\DuplexStreamInterface $stream
* @param \React\Socket\ConnectionInterface $stream
* @param \Psr\Http\Message\ResponseInterface $response
* @param \Psr\Http\Message\RequestInterface $request
* @event message
* @event pong
* @event close
* @event error
*/
public function __construct(DuplexStreamInterface $stream, ResponseInterface $response, RequestInterface $request) {
public function __construct(ConnectionInterface $stream, ResponseInterface $response, RequestInterface $request) {
$this->_stream = $stream;
$this->response = $response;
$this->request = $request;
Expand Down Expand Up @@ -103,13 +103,6 @@ function() use ($reusableUAException) {

$stream->on('data', [$streamer, 'onData']);

$stream->on('end', function(DuplexStreamInterface $stream) {
if (is_resource($stream->stream)) {
stream_socket_shutdown($stream->stream, STREAM_SHUT_RDWR);
stream_set_blocking($stream->stream, false);
}
});

$stream->on('close', function () {
$close = $this->_close;
$close(Frame::CLOSE_ABNORMAL, 'Underlying connection closed');
Expand Down

0 comments on commit d2c3e06

Please sign in to comment.