# nodemsg **Repository Path**: moonty/nodemsg ## Basic Information - **Project Name**: nodemsg - **Description**: mom's node portion - **Primary Language**: NodeJS - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-04-06 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #nodemsg([mom](https://github.com/lizs/mom.git)'s node portion) --- ###Getting started ```C# // custom handler class MyHandler { constructor() { } // handle push onPush(session, message) { } // handle request onRequest(session, message, cb) { // response cb(NetError.Success, null) } // handle session closed onClose(session) { console.log('session ', session.id, ' closed') } // handle session established onOpen(session) { console.log('session ', session.id, ' established') } } // start server let server = new tcpServer("localhost", 5002, new MyHandler()) server.start() // start client let client = new tcpClient("localhost", 5002, new MyHandler()) client.start() ``` ###Question QQ Group : [点击加入](http://jq.qq.com/?_wv=1027&k=VptNja) e-mail : lizs4ever@163.com