示例#1
0
func NewPacketInjectorClient(w *shttp.WSServer) *PacketInjectorClient {
	pic := &PacketInjectorClient{
		WSServer:  w,
		replyChan: make(map[string]chan *json.RawMessage),
	}
	w.AddEventHandler(pic)

	return pic
}
示例#2
0
文件: client.go 项目: nplanel/skydive
func NewTableClient(w *shttp.WSServer) *TableClient {
	tc := &TableClient{
		WSServer:  w,
		replyChan: make(map[string]chan *json.RawMessage),
	}
	w.AddEventHandler(tc)

	return tc
}
示例#3
0
文件: server.go 项目: nplanel/skydive
func NewServer(a *AlertManager, server *shttp.WSServer) *AlertServer {
	s := &AlertServer{
		AlertManager: a,
		WSServer:     server,
		clients:      make(map[*shttp.WSClient]*alertClient),
	}
	server.AddEventHandler(s)

	return s
}
示例#4
0
文件: server.go 项目: nplanel/skydive
func NewServer(g *Graph, server *shttp.WSServer) *GraphServer {
	s := &GraphServer{
		Graph:    g,
		WSServer: server,
	}
	s.Graph.AddEventListener(s)
	server.AddEventHandler(s)

	return s
}