Closed pokal4u closed 12 years ago
if you create n objects of PushStream you will be doing one connection to each object, and the browser has a limit to this. the right way to connect to multiple channels is the first one you used, calling the addChannel multiple times. probably you are doing something wrong when publishing the messages, I did a test here and everything worked.
Regards, Wandenberg
Hi, Thanks for reply.
Actually i am doing gmail type chat application, so i am trying to create individual channels
here i am created one 'pushstream object' and add 'multiple channels' and 'connect all onetime' like this var pushstream = new PushStream({ host: window.location.hostname, port: window.location.port, modes: "longpolling", secondsAgo:3600
}); pushstream.addChannel('chan1'); pushstream.addChannel('chan2'); pushstream.addChannel('chan3'); pushstream.addChannel('chan4'); pushstream.addChannel('chan5');
pushstream.connect();
please let me know where i done mistake? and tell me how to connect?
Thanks
Hi,
I connect to multiple channels like this
var pushstream = new PushStream({ host: window.location.hostname, port: window.location.port, modes: "longpolling", secondsAgo:3600
}); pushstream.addChannel('chan1'); pushstream.addChannel('chan2'); pushstream.addChannel('chan3'); pushstream.addChannel('chan4'); pushstream.addChannel('chan5');
pushstream.connect();
Then send messages to every channel messages are received "chan1" only.
And if i connect like this:
var i=1; while(6<i){
var pushstream = new PushStream({ host: window.location.hostname, port: window.location.port, modes: "longpolling", secondsAgo:3600
}); pushstream.addChannel('chan'+i);
pushstream.connect();
i++; }
it's work fine but connect max 5 only if i connect above 5 connections notworking(take the load for send and receive messages).
Please help me urgent
Thanks
and my config file like this
pid logs/nginx.pid; error_log logs/nginx-main_error.log debug; Development Mode
master_process off; daemon off; worker_rlimit_core 500M; working_directory /tmp/nginx;
worker_processes 2;
events { worker_connections 1024; use epoll; }
http { include mime.types; default_type application/octet-stream;
access_log logs/nginx-http_access.log; error_log logs/nginx-http_error.log debug;
tcp_nopush off; tcp_nodelay on; keepalive_timeout 10; send_timeout 10; client_body_timeout 10; client_header_timeout 10; sendfile on; client_header_buffer_size 1k; large_client_header_buffers 2 4k; client_max_body_size 1k; client_body_buffer_size 1k; ignore_invalid_headers on;
push_stream_shared_memory_size 100m; push_stream_max_channel_id_length 200;
max messages to store in memory
push_stream_max_messages_stored_per_channel 20;
message ttl
push_stream_message_ttl 5m;
ping frequency
push_stream_ping_message_interval 10s;
connection ttl to enable recycle
push_stream_subscriber_connection_ttl 15m;
connection ttl for long polling
push_stream_longpolling_connection_ttl 30s;
broadcast
push_stream_broadcast_channelprefix "broad";
push_stream_message_template "{\"id\":~id~,\"channel\":\"~channel~\",\"text\":\"~text~\",\"eventid\":\"~event-id~\"}";
push_stream_message_template "{\"id\":~id~,\"channel\":\"~channel~\",\"text\":\"~text~\"}";
subscriber may create channels on demand or only authorized
(publisher) may do it?
push_stream_authorized_channels_only off; push_stream_broadcast_channel_max_qtd 3;
server { listen 9080 default_server;
listen 9443 ssl;
}