@@ -11,19 +11,19 @@ import (
11
11
"time"
12
12
)
13
13
14
- type Server struct {
14
+ type server struct {
15
15
hub HubInterface
16
16
lifetimeManager HubLifetimeManager
17
- defaultHubClients defaultHubClients
17
+ defaultHubClients HubClients
18
18
groupManager GroupManager
19
19
}
20
20
21
- func NewServer (hub HubInterface ) * Server {
21
+ func newServer (hub HubInterface ) * server {
22
22
lifetimeManager := defaultHubLifetimeManager {}
23
- return & Server {
23
+ return & server {
24
24
hub : hub ,
25
25
lifetimeManager : & lifetimeManager ,
26
- defaultHubClients : defaultHubClients {
26
+ defaultHubClients : & defaultHubClients {
27
27
lifetimeManager : & lifetimeManager ,
28
28
allCache : allClientProxy {lifetimeManager : & lifetimeManager },
29
29
},
@@ -33,7 +33,7 @@ func NewServer(hub HubInterface) *Server {
33
33
}
34
34
}
35
35
36
- func (s * Server ) messageLoop (conn Connection ) {
36
+ func (s * server ) messageLoop (conn Connection ) {
37
37
if protocol , err := processHandshake (conn ); err != nil {
38
38
fmt .Println (err )
39
39
} else {
@@ -65,7 +65,7 @@ func (s *Server) messageLoop(conn Connection) {
65
65
// argument build failed
66
66
hubConn .Completion (invocation .InvocationID , nil , err .Error ())
67
67
} else if clientStreaming {
68
- // let the receiving method run idependently
68
+ // let the receiving method run independently
69
69
go func () {
70
70
defer func () {
71
71
if err := recover (); err != nil {
@@ -124,10 +124,10 @@ type hubInfo struct {
124
124
methods map [string ]reflect.Value
125
125
}
126
126
127
- func (s * Server ) newHubInfo () * hubInfo {
127
+ func (s * server ) newHubInfo () * hubInfo {
128
128
129
129
s .hub .Initialize (& defaultHubContext {
130
- clients : & s .defaultHubClients ,
130
+ clients : s .defaultHubClients ,
131
131
groups : s .groupManager ,
132
132
})
133
133
@@ -286,7 +286,7 @@ func processHandshake(conn Connection) (HubProtocol, error) {
286
286
}
287
287
288
288
var protocolMap = map [string ]HubProtocol {
289
- "json" : & JsonHubProtocol {},
289
+ "json" : & jsonHubProtocol {},
290
290
}
291
291
292
292
type availableTransport struct {
0 commit comments