1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 18:07:01 +00:00

Update to 3.0.0-rc.1 - Read the HISTORY.md. Relative: #183 #184 #166 #176 #181

Read https://github.com/kataras/iris/tree/master/HISTORY.md
This commit is contained in:
Makis Maropoulos
2016-06-14 08:45:40 +03:00
parent 2da67206c8
commit d837381b16
59 changed files with 3972 additions and 4927 deletions

View File

@@ -20,6 +20,8 @@ type (
Upgrade(context.IContext) error
// OnConnection registers a callback which fires when a connection/client is connected to the server
OnConnection(ConnectionFunc)
// Config returns a pointer to server's configs
Config() *config.Websocket
}
// roomPayload is used as payload from the connection to the server
@@ -57,9 +59,10 @@ var _ Server = &server{}
// server implementation
func newServer(c config.Websocket) *server {
// newServer creates a websocket server and returns it
func newServer(c *config.Websocket) *server {
s := &server{
config: &c,
config: c,
put: make(chan *connection),
free: make(chan *connection),
connections: make(map[string]*connection),
@@ -72,10 +75,13 @@ func newServer(c config.Websocket) *server {
s.upgrader = websocket.New(s.handleConnection)
go s.serve() // start the server automatically
return s
}
func (s *server) Config() *config.Websocket {
return s.config
}
func (s *server) Upgrade(ctx context.IContext) error {
return s.upgrader.Upgrade(ctx)
}