Skip to content

Commit 5767f29

Browse files
author
lukasz
committed
removing debug code
1 parent e898c76 commit 5767f29

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

sock/SocketServerBroadcast.php

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,32 +61,14 @@ protected function beforeServerLoop() {
6161
parent::beforeServerLoop();
6262
socket_set_nonblock( $this->sockServer );
6363
pcntl_signal(SIGUSR1, array($this, 'handleProcess'), true);
64-
//pcntl_signal(SIGINT, array($this, 'stop'), true);
65-
}
66-
67-
protected function stop() {
68-
echo "\nClosing active connections...\n";
69-
$this->_listenLoop = false;
70-
foreach( $this->connections as $conn ) {
71-
$conn->close();
72-
}
73-
echo "Shutting down server...\n";
74-
fclose($this->pipe);
75-
$this->pipe = fopen(self::PIPENAME, 'w');
76-
fclose($this->pipe);
77-
echo unlink( self::PIPENAME ) ? 'removed' : 'not removed';
78-
pcntl_wait($status);
7964
}
8065

8166
protected function serverLoop() {
8267
while( $this->_listenLoop ) {
8368
if( ( $client = @socket_accept( $this->sockServer ) ) === false ) {
8469
$info = array();
85-
if( pcntl_sigtimedwait(array(SIGUSR1, SIGINT),$info,1) > 0 ) {
86-
if( $info['signo'] == SIGINT ) {
87-
$this->stop();
88-
}
89-
else{
70+
if( pcntl_sigtimedwait(array(SIGUSR1),$info,1) > 0 ) {
71+
if( $info['signo'] == SIGUSR1 ) {
9072
$this->handleProcess();
9173
}
9274
}

0 commit comments

Comments
 (0)