From 25216db1253b7a59ce73adfdcd85e3cd6dd5dd54 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 26 Apr 2018 23:26:51 +0200 Subject: [PATCH] added Client set into Server --- ws/types.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ws/types.go b/ws/types.go index 9159ac8..1216029 100644 --- a/ws/types.go +++ b/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 {