public function onFrame($data, $type)
    {
        foreach (explode("\n", $data) as $pct) {
            if ($pct === '') {
                continue;
            }
            $this->onPacket(json_decode($pct, true));
        }
    }
public function onFrame($data, $type)
    {
        foreach (explode("\n", $data) as $pct) {
            if ($pct === '') {
                continue;
            }
            $this->onPacket(json_decode($pct, true));
        }
    }
public function onFrame ( $ data , $ type ) { foreach ( explode ( "\n" , $ data ) as $ pct ) { if ( $ pct === '' ) { continue ; } $ this -> onPacket ( json_decode ( $ pct , true ) ) ; } }
Called when new frame is received
@param string $data Frame's contents
@param integer $type Frame's type
@return void
Called when new frame is received