added Client set into Server

This commit is contained in:
xdrm-brackets 2018-04-26 23:26:51 +02:00
parent 9fcd36d13d
commit 25216db125
1 changed files with 10 additions and 8 deletions

View File

@ -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 // Represents a websocket srever
type Server struct { type Server struct {
soc net.Listener // listen socket soc net.Listener // listen socket
adr []byte // server listening ip/host adr []byte // server listening ip/host
prt uint16 // server listening port prt uint16 // server listening port
cli []*Client // clients
def *Controller // default controller def *Controller // default controller
ctl []*Controller // URI-bound controllers 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 // Represents a websocket frame
type Frame struct { type Frame struct {