Skip to content

Commit 31b4992

Browse files
committed
Add close event
1 parent b60f6f0 commit 31b4992

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

Datagram/Socket.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ public function onReceive($message)
7878

7979
public function close()
8080
{
81+
$this->emit('close', array($this));
8182
$this->pause();
83+
8284
fclose($this->socket);
8385
$this->socket = false;
8486
}

Datagram/SocketInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/**
88
* @event message($data, $remoteAddress, $thisSocket)
99
* @event error($exception, $thisSocket)
10+
* @event close($thisSocket)
1011
*/
1112
interface SocketInterface extends EventEmitterInterface
1213
{

0 commit comments

Comments
 (0)