summaryrefslogtreecommitdiff
path: root/src/globster/hub/hub.go
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2012-04-10 16:41:51 +0200
committerYorhel <git@yorhel.nl>2012-04-10 16:41:51 +0200
commit56251e336627d1ef64d29dfd93f178f7f857ba6d (patch)
tree3a48547306fea8ca17d193548b4a55f644d10d23 /src/globster/hub/hub.go
parent7da6230ae0a3fbd003170639f3918fa77b98944a (diff)
Added (a crappy but functional) userlist session
This also handles our user info for hubs, to avoid keeping a separate "this user" entity in the hub session and associated tuples for managing that.
Diffstat (limited to 'src/globster/hub/hub.go')
-rw-r--r--src/globster/hub/hub.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/globster/hub/hub.go b/src/globster/hub/hub.go
index fb7b377..5bf7f79 100644
--- a/src/globster/hub/hub.go
+++ b/src/globster/hub/hub.go
@@ -3,20 +3,20 @@ package hub
import (
"globster/adc"
"go.blicky.net/tanja"
- "time"
"net"
+ "time"
)
// TODO: Do the connect() and write()s in a separate goroutine.
type hub struct {
- name string
- ses *tanja.Session
- conn net.Conn
+ name string
+ ses *tanja.Session
+ conn net.Conn
}
func newHub(node *tanja.Node, name string) *hub {
- s := &hub{name:name, ses:node.Session()}
+ s := &hub{name: name, ses: node.Session()}
s.ses.RegRPC(s, func(s string) tanja.Tuple {
if s[0] != 'T' {
@@ -45,7 +45,7 @@ func (s *hub) Tconnect(addr string) {
s.ses.Send(false, "hub", s.name, "Disconnected", e.Error())
} else {
s.ses.Send(false, "hub", s.name, "Connected", s.conn.RemoteAddr().String())
- adc.NewWriter(s.conn).Write(&adc.Message{Header:adc.SUP.SetType('I')})
+ adc.NewWriter(s.conn).Write(&adc.Message{Header: adc.SUP.SetType('I')})
}
}