Permalink
Browse files

renamed properties

  • Loading branch information...
1 parent 1596dac commit de4712d131bd800d4013aeef8bdb6a9a25dbdc13 max committed Mar 26, 2012
Showing with 15 additions and 15 deletions.
  1. +15 −15 src/FuseSource/Stomp/StompClient.php
@@ -53,9 +53,9 @@ class StompClient
protected $logger;
protected $connected = false;
- protected $_attempts = 10;
- protected $_socket;
- protected $_sessionId;
+ protected $attempts = 10;
+ protected $socket;
+ protected $sessionId;
protected $base;
protected $subscribedEventNames = [];
@@ -94,33 +94,33 @@ public function setDispatcher(EventDispatcherInterface $dispatcher)
public function getSessionId()
{
- return $this->_sessionId;
+ return $this->sessionId;
}
protected function openSocket()
{
$connected = false;
$connectionAttempts = 0;
- while (!$connected && $connectionAttempts < $this->_attempts) {
+ while (!$connected && $connectionAttempts < $this->attempts) {
$connectionErrorNumber = $connectionError = null;
- $this->_socket = @fsockopen(
+ $this->socket = @fsockopen(
'tcp://' . $this->brokerUri->getHost(),
$this->brokerUri->getPort(),
$connectionErrorNumber,
$connectionError,
$this->options['connectTimeout']
);
- if (is_resource($this->_socket)) {
+ if (is_resource($this->socket)) {
$this->logger->info(sprintf('Successfully connected to socket at attempt %d', $connectionAttempts));
return;
}
- if ($this->_socket) {
- @fclose($this->_socket);
+ if ($this->socket) {
+ @fclose($this->socket);
}
$connectionAttempts++;
@@ -135,7 +135,7 @@ protected function writeFrame(Frame $frame)
$this->logger->debug('Writing frame data', array('data' => $data));
- $success = (bool) fwrite($this->_socket, $data, strlen($data));
+ $success = (bool) fwrite($this->socket, $data, strlen($data));
$this->logger->debug('Frame written to socket', array('success' => $success));
@@ -200,7 +200,7 @@ protected function startEventLoop()
$this->logger->info('Starting event loop');
$this->base = event_base_new();
- $eb = event_buffer_new($this->_socket, $readCallback, NULL, $errorCallback, $this->base);
+ $eb = event_buffer_new($this->socket, $readCallback, NULL, $errorCallback, $this->base);
event_buffer_base_set($eb, $this->base);
event_buffer_enable($eb, EV_READ);
@@ -306,9 +306,9 @@ public function connect()
});
$this->dispatcher->addListener(SystemEventType::FRAME_CONNECTED, function(FrameEvent $event) {
- $this->_sessionId = $event->getFrame()->getHeaders()['session'];
+ $this->sessionId = $event->getFrame()->getHeaders()['session'];
- $this->logger->info('Successfully connected to server', ['sessionId' => $this->_sessionId]);
+ $this->logger->info('Successfully connected to server', ['sessionId' => $this->sessionId]);
$this->breakEventLoop();
@@ -401,9 +401,9 @@ public function disconnect()
$headers['client-id'] = $this->options['clientId'];
}
- if (is_resource($this->_socket)) {
+ if (is_resource($this->socket)) {
$this->writeFrame(Frame::createNew('DISCONNECT', $headers));
- fclose($this->_socket);
+ fclose($this->socket);
}
}

0 comments on commit de4712d

Please sign in to comment.