func socketHandler(inst *wsock.SocketInstance, length int64, data io.Reader) error { d := make([]byte, length) data.Read(d) fmt.Printf("Message: %q\n", d) inst.Write(d) return nil }
func socketConnectionHandler(inst *wsock.SocketInstance) error { err := inst.ReadLoop() fmt.Printf("connection closed %q\n", err) return err }