Commit 03b8df99 by 蒋勇

d

parent eba45937
...@@ -65,7 +65,7 @@ class SocketServer { ...@@ -65,7 +65,7 @@ class SocketServer {
}); });
// this.server.adapter(redisAdapter({ pubClient: redisClient.client, subClient: redisClient.subclient })); // this.server.adapter(redisAdapter({ pubClient: redisClient.client, subClient: redisClient.subclient }));
this.server.engine.generateId = (req) => { this.server.engine.generateId = (req) => {
console.log(req.headers) // console.log(req.headers)
return "custom:id:" + this.getUUID(); // custom id must be unique return "custom:id:" + this.getUUID(); // custom id must be unique
} }
this.init() this.init()
...@@ -79,8 +79,7 @@ class SocketServer { ...@@ -79,8 +79,7 @@ class SocketServer {
var self = this.server; var self = this.server;
this.server.on('connection', function (client) { this.server.on('connection', function (client) {
console.log("connection.....socket"); console.log("connection.....socket");
client.emit("news", { ok: "ddd" }) client.on("login", (d) => {
client.on("shandle", (d) => {
console.log(d) console.log(d)
}) })
// //
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment