alaingilbert / Turntable-API

Allows you to create bots for turntable.fm
http://alaingilbert.github.com/Turntable-API/
MIT License
317 stars 98 forks source link

Socket is not writable #59

Open mcgrailm opened 12 years ago

mcgrailm commented 12 years ago

at about 1 AM EST I got this error on more than 1 bot

net.js:391
    throw new Error('Socket is not writable');
          ^
Error: Socket is not writable
    at Client._writeOut (net.js:391:11)
    at Client.write (net.js:377:17)
    at [object Object].<anonymous> (/node_modules/ttapi/websocket.js:449:16)
    at [object Object]._send (/node_modules/ttapi/bot.js:299:12)
    at [object Object].updatePresence (/node_modules/ttapi/bot.js:333:9)
    at Timer.callback (/node_modules/ttapi/bot.js:148:47)

not sure if this is due to an interruption by tt or by my server ?

I would appreciate any advice you could give here Mike

oldramen commented 12 years ago

I get these every so often. I've always assumed they've been TT errors.
I would use something like forever or supervisor to run them,
because they automatically restart processes when the crash.

mcgrailm commented 12 years ago

Yayramen,

thank you those are good resources. To me though that sounds a like temporary solution. The fact that tt is unavailable shouldn't cause everything to come to a screeching halt. whatever is causing the error instead of throwing an error like that should come come back with a graceful response that can be bubbled up an appropriate point in the decision tree. So that a decision can be made programmatically about what should be done

a) keep trying x times b) skip and try again later

thats just an example.

Mike