Exemplo n.º 1
0
func (s *Server) sockjsHandler(c *gosockjs.Conn) {
	// Acknowledge.
	ack, err := ToJSON(struct{ Server_id string }{s.uuid})
	if err != nil {
		log.Print(err)
		return
	}
	c.Write(ack)

	// We should probably do this with callbacks.
	// Create and start a Stream, a thin layer on top of sockjs.
	// Also create a session.
	// Hand control to the stream and session.

	session := newSession(s, c)
	session.Run()
}
Exemplo n.º 2
0
func closeSock(c *gosockjs.Conn) {
	c.Close()
}