Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined Index 1 on line #8

Open
banank1989 opened this issue Feb 9, 2016 · 0 comments
Open

Undefined Index 1 on line #8

banank1989 opened this issue Feb 9, 2016 · 0 comments

Comments

@banank1989
Copy link

I am using this socket.io.php file.
When i am calling the send function, i am gettting error message on this line

preg_match('#Sec-WebSocket-Accept:\s(.*)$#mU', $result, $matches);

Basically the $result on the line above is coming blank.($result= fread($fd,10000);)
But i am not able to identify what is the issue.
On my nodejs server, as the hit is made, this error is coming
* warn - unknown transport: "undefined"*

My code for emitting event is

if ($socketio->send('localhost', 8080, "message","hello")){
echo "we sent the message and disconnected \n";
} else {
echo 'Sorry, we have a mistake :'(';
}

My Nodejs Server

var socket = require('socket.io');
var express = require('express');
var http = require('http');

var app = express();
var server = http.createServer(app);

var io = socket.listen(server);
console.log('hereeee');
io.sockets.on('connection', function(client) {

client.on('message', function(data) {
    console.log('Message received ' + data.count);
    //io.sockets.emit('message', { data : data.count});
});

});

server.listen(8080);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant