Open Mamepoker opened 10 years ago
hi, here the bug in the example, need to wrap all code in
socket.onConnect(function () {
});
like in the documentation
and check if nodejs process is working
$> pgrep node
hi,
I try simple code this is my code in controller
and my javascript code
It just alert and console "hello 3"
I'm not sure in this case. It can't connect to socket.io right ?
and I try check nodejs process & start it
how can I fix it ?
thank you :)
Hi, port 3001 is taken, try 3004
seems like your os is windows and pgrep command does not exists in git bash shell
your alert('hello 3'); just says that you connected to socket.io and can catch or send events
hi
I changed port in config/main.php , config/console.php , extensions/yii-node-socket/lib/js/server/server.config.js .
from port 3001 to 3004
and yiic node-socket restart
but when I open index.php?r=nsEventExample/eventListener , I got it
How to fix it ?
Ps.Sry I'm newbie in websocket :(
old url to socket.io.js port 3004 but in console log 3001
you must clear assets
It really join case on onConnect. :)
Thank you so much :+1:
not at all
hi,
I try send event with php this is my code
and this is my javascript
but I don't got any message this is my log
I'm not sure, What 's wrong in php side ? or Can I get error Message in php side ?
Thank you
=) because event from php very fast and it was executed before php render your template =)
you should emit event in one action you should listen events in javascript on loaded page (before you send event from php) it can be othe browser tab and action
hi,
Do you have any example ?
sorry, but i do not have =)
I trying follow this
1.I open index.php?r=nsEventExample/eventListener in new tab
2.I click to sendRoomEvent
How to fix it
ps. sry to my english.