nkzawa / socket.io-stream

Stream for Socket.IO
MIT License
611 stars 111 forks source link

how to send to room? #54

Open mike-aungsan opened 9 years ago

mike-aungsan commented 9 years ago

Client/Browser upload file with file event. ss(socket).emit('file', stream, {size: file.size, name: file.name})

Then I can pipe back to the client from server. ss(socket).on('file', function (stream, data) {

var outStream = ss.createStream() ss(socket).emit('file', outStream, data)

//outStream.pipe(stream) // this is wrong stream.pipe(outStream) })

But I want to sent it to the room. For example, send msg to the room with socketio / sio sio.sockets.in('roomName').emit('msg', JSON.stringify(msgObj))

How can I sent stream to the room?

Regards,

Mike

Ref: http://stackoverflow.com/questions/10058226/send-response-to-all-clients-except-sender-socket-io

nkzawa commented 9 years ago

Unfortunately there is no support for rooms and broadcasting for now.

mike-aungsan commented 9 years ago

Many Thanks for info.

From server to client(s) in the room, I can send file as regular msg. Would it be much different with sending as stream?

Shadowstep33 commented 8 years ago

I would very much so like to see this. If a bunch of users are interracting in an infinite procedurally generated world, it would be useful to just stream the updated terrain data to the whole room instead of iterating through each clients client_socket obj.

DinoscapeProgramming commented 4 months ago

Any update? 🙂