示例#1
0
文件: server.go 项目: nplanel/skydive
func NewServer(allocator *TableAllocator, client *shttp.WSAsyncClient) *TableServer {
	s := &TableServer{
		TableAllocator: allocator,
		WSAsyncClient:  client,
	}
	client.AddEventHandler(s)

	return s
}
示例#2
0
func NewForwarder(c *shttp.WSAsyncClient, g *Graph, host string) *Forwarder {
	f := &Forwarder{
		Client: c,
		Graph:  g,
		Host:   host,
	}

	g.AddEventListener(f)
	c.AddEventHandler(f)

	return f
}
示例#3
0
func NewForwarder(c *shttp.WSAsyncClient, g *Graph, root *Node) *Forwarder {
	f := &Forwarder{
		Client: c,
		Graph:  g,
		Root:   root,
	}

	g.AddEventListener(f)
	c.AddEventHandler(f)

	return f
}