oncesk / yii-node-socket

66 stars 46 forks source link

Undefined offset: 3 #92

Open GerarPacheco opened 6 years ago

GerarPacheco commented 6 years ago

Hello I am trying to use your extension in Yii 1.19 and it does not work for me, it gives me the following error

Undefined offset: 3

I send you the used code fragments

config / console.php

return array( 'basePath'=>dirname(FILE).DIRECTORY_SEPARATOR.'..', 'name'=>'My Console Application', 'commandMap' => array( 'node-socket' => 'application.extensions.yii-node-socket.lib.php.NodeSocketCommand' ), // preloading 'log' component 'preload'=>array('log','nodeSocket'),

// application components
'components'=>array(
    'db'=>array(
        'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
    ),
    'nodeSocket' => array(
        'class' => 'application.extensions.yii-node-socket.lib.php.NodeSocket',
        'host' => '192.168.101.161',    // default is 127.0.0.1, can be ip or domain name, without http
        'port' => 50000,    // default is 3001, should be integer
        'allowedServerAddresses'=>array('127.0.0.1')
    ),

config / main.php 'components' => array( 'nodeSocket' => array( 'class' => 'application.extensions.yii-node-socket.lib.php.NodeSocket', 'host' => '192.168.101.161', // default is 127.0.0.1, can be ip or domain name, without http 'port' => 50000, ),

SiteController /index public function actionIndex() { $frame = Yii::app()->nodeSocket->getFrameFactory()->createEventFrame(); $frame->setEventName('broadcast'); $frame->setRoom('test'); $frame['testsss'] = 12;

What could be happening? Thanks

agueroveraalvaro commented 6 years ago

Me too, I didn't find the solution, any ideas??

oncesk commented 6 years ago

hello, which version you try to use, there exists 2 versions one for yii2 and one for yii 1

2.0.8 https://github.com/oncesk/yii-node-socket/tree/2.0.8 - for yii 2 2.0.1 - yii1

2018-01-20 0:07 GMT+03:00 Alvaro Aguero notifications@github.com:

Me too, I didn't find the solution, any ideas??

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/oncesk/yii-node-socket/issues/92#issuecomment-359089102, or mute the thread https://github.com/notifications/unsubscribe-auth/AB84jBziiZ9W1jXrIilJ_9s0BH22S_-Mks5tMQP7gaJpZM4RlB03 .