php - Call my function instead anonymous function -


i have anonymous function running in onconnect event. how call function onconnect() instead anonymous function ?

$this->server->on("connect", function (websockettransportinterface $user) {             $this->logger->notice((" connected " . $user->getip()));         }); 

and

public function onconnect(websockettransportinterface $user) {     $this->logger->notice((" connected " . $user->getip()));      } 

something

 $this->server->on("connect", onconnect($user)); 

just this

$this->server->on("connect", 'onconnect'); 

and if in same class, this:

$this->server->on("connect", array($this, 'onconnect')); 

Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -