Changeset View
Changeset View
Standalone View
Standalone View
support/aphlict/server/lib/AphlictClientServer.js
| Show First 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | listen: function() { | ||||
| try { | try { | ||||
| listener.writeMessage(old_message); | listener.writeMessage(old_message); | ||||
| } catch (error) { | } catch (error) { | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| break; | break; | ||||
| case 'ping': | |||||
| var pong = { | |||||
| type: 'pong' | |||||
| }; | |||||
| try { | |||||
| listener.writeMessage(pong); | |||||
| } catch (error) { | |||||
| // Ignore any issues here, we'll clean up elsewhere. | |||||
| } | |||||
| break; | |||||
| default: | default: | ||||
| log( | log( | ||||
| 'Unrecognized command "%s".', | 'Unrecognized command "%s".', | ||||
| message.command || '<undefined>'); | message.command || '<undefined>'); | ||||
| } | } | ||||
| }); | }); | ||||
| ws.on('close', function() { | ws.on('close', function() { | ||||
| Show All 9 Lines | |||||