回复:2 service: resource or namespace?

18 views
Skip to first unread message

何必奇怪♂

unread,
Mar 8, 2012, 2:56:19 AM3/8/12
to socket_io
 
 
------------------ 原始邮件 ------------------
发件人: "Mattia Toso";
发送时间: 2012年3月8日(星期四) 上午8:35
收件人: "socket_io";
主题: 2 service: resource or namespace?
 
Hi,

I am developing a web application that provides various services provided by node and put into communication with the client through socket.io

Services are 2 main: chat and a whiteboard.


I would like to know what the best solution: Implement 1 single namespace server with 2 "/ chat" and "/ canvas" (it seems to me ugly and heavy mix code and only have 1 server) or use 2 resource?


Which solution works best socket.io? What would you recommend?


Thanks

tom heng

unread,
Mar 8, 2012, 4:56:27 AM3/8/12
to sock...@googlegroups.com
soket.io can support multi namespace on single server

2012/3/8 何必奇怪♂ <5687...@qq.com>



--
^_^  

tomheng
趣味互联网 http://blog.webfuns.net

Mattia Toso

unread,
Mar 8, 2012, 6:36:09 AM3/8/12
to sock...@googlegroups.com
I know this, but if i have two service with 2 different connection (Ex: pad and canvas ) and i use ssl with proxy??


Javier Viola

unread,
Mar 8, 2012, 7:24:58 AM3/8/12
to sock...@googlegroups.com
Hi Mattia,
                You also can use rooms, using one namespace but with two or more rooms, and then brodcasts messages to all connections in that room, the only extra thing you have to code is that the client send a message when connect to inform what room want to connect.
I made an app with dynamics rooms, if you are interesting i post the code for that. 

Best regards.-

2012/3/8 Mattia Toso <matti...@gmail.com>

Mattia Toso

unread,
Mar 8, 2012, 7:32:25 AM3/8/12
to sock...@googlegroups.com
Hi Javier,
already use the room, where users may then or chat or draw, so I should use a subtype of room?
one room for the chat room and another room for canvas embedded into a generalroom?

if it is not a porblem i appreciate if you submit the code.

thanks
Reply all
Reply to author
Forward
0 new messages