File: sockjs.go

package info (click to toggle)
golang-github-igm-sockjs-go 3.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 512 kB
  • sloc: javascript: 39; makefile: 5
file content (19 lines) | stat: -rw-r--r-- 589 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package sockjs

import "net/http"

// Session represents a connection between server and client.
type Session interface {
	// Id returns a session id
	ID() string
	// Request returns the first http request
	Request() *http.Request
	// Recv reads one text frame from session
	Recv() (string, error)
	// Send sends one text frame to session
	Send(string) error
	// Close closes the session with provided code and reason.
	Close(status uint32, reason string) error
	//Gets the state of the session. SessionOpening/SessionActive/SessionClosing/SessionClosed;
	GetSessionState() SessionState
}