added Client set into Server
This commit is contained in:
parent
9fcd36d13d
commit
25216db125
18
ws/types.go
18
ws/types.go
|
@ -16,24 +16,26 @@ type Controller struct {
|
|||
}
|
||||
|
||||
|
||||
// Represents a websocket client
|
||||
type Client struct {
|
||||
soc net.Conn // communication socket
|
||||
pro string // choosen protocol (Sec-WebSocket-Protocol)
|
||||
arg [][]string // URI parameters, index 0 is full URI, then matching groups
|
||||
Dat interface{} // store (for client implementation-specific data)
|
||||
}
|
||||
|
||||
// Represents a websocket srever
|
||||
type Server struct {
|
||||
soc net.Listener // listen socket
|
||||
adr []byte // server listening ip/host
|
||||
prt uint16 // server listening port
|
||||
|
||||
cli []*Client // clients
|
||||
|
||||
def *Controller // default controller
|
||||
ctl []*Controller // URI-bound controllers
|
||||
}
|
||||
|
||||
// Represents a websocket client
|
||||
type Client struct {
|
||||
soc net.Conn // communication socket
|
||||
pro string // choosen protocol (Sec-WebSocket-Protocol)
|
||||
arg [][]string // URI parameters, index 0 is full URI, then matching groups
|
||||
dat interface{} // store (for client implementation-specific data)
|
||||
}
|
||||
|
||||
|
||||
// Represents a websocket frame
|
||||
type Frame struct {
|
||||
|
|
Loading…
Reference in New Issue