PHP_SocketIO_Client icon indicating copy to clipboard operation
PHP_SocketIO_Client copied to clipboard

Undefined Index 1 on line

Open ban1989ban opened this issue 9 years ago • 0 comments

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);

ban1989ban avatar Feb 09 '16 09:02 ban1989ban