xmpp-ftw / xmpp-ftw-demo

Demos/examples of using xmpp-ftw
http://xmpp-ftw.org
25 stars 8 forks source link

ECONNRESET #243

Open sinchi opened 6 years ago

sinchi commented 6 years ago

i try to reconnect a user to xmpp server when he refresh the page i get this error on nodejs :

{ Error: read ECONNRESET at _errnoException (util.js:1003:13) at TLSWrap.onread (net.js:620:25) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' }

this is my code :

var socket = new Primus(host);

const options = JSON.parse(localStorage.getItem('options')); var login = function() { socket.send('xmpp.login', options, function(){ console.log("Send login"); }); socket.on('xmpp.connection', function(data) { console.log('Connected as', data.jid) }) }

socket.on('open', function() { console.log('Connected to server'); if(options){ login(); } })

lloydwatkin commented 6 years ago

Have you run out of TCP connections? This could cause throwing of this error, what's your max connections and how many are you using?

sinchi commented 6 years ago

i checked the tcp connection and this is what i found on linux ubuntu :

~$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 11294 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 11294 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited

~$ cat /proc/sys/kernel/pid_max 32768 ~$ cat /proc/sys/net/ipv4/ip_local_port_range 32768 60999