Esempio n. 1
0
func (c User) Comm(ws *websocket.Conn) revel.Result {
	user := c.userConnected()
	revel.WARN.Println(user)

	comm := ws_comm.New()
	comm.AddHandler("echo", echoHandler)

	comm.Serve(ws)

	revel.INFO.Println("closing WS connection")
	return nil
}
Esempio n. 2
0
func (c User) Comm(ws *websocket.Conn) revel.Result {
	user := c.userConnected()

	comm := ws_comm.New()
	comm.AddHandler("echo", echoHandler)

	if user.UserId == 200001 {
		comm.AddHandler("email", emailHandler)
	}

	comm.Serve(ws)

	revel.INFO.Println("closing WS connection")
	return nil
}