Skip to content

Commit

Permalink
Merge pull request #9 from Fastto/writeExeptionFix
Browse files Browse the repository at this point in the history
fix exeption type in write method
  • Loading branch information
Alisher committed Apr 24, 2014
2 parents 10c4306 + 0555f89 commit 6d22c7d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Aysheka/Socket/Socket.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Aysheka\Socket\Event\Init\OpenEvent;
use Aysheka\Socket\Exception\IO\ReadException;
use Aysheka\Socket\Exception\Init\OpenException;
use Aysheka\Socket\Exception\IO\WriteException;
use Aysheka\Socket\Transport\Transport;
use Aysheka\Socket\Type\Type;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
Expand Down Expand Up @@ -92,7 +93,7 @@ function read($length = 1024)
function write($data)
{
if (!socket_write($this->socketResource, $data, strlen($data))) {
throw new ReadException($this, $data);
throw new WriteException($this, $data);
}

$this->getEventDispatcher()->dispatch(WriteEvent::getEventName(), new WriteEvent($this, $data));
Expand Down

0 comments on commit 6d22c7d

Please sign in to comment.