Beispiel #1
0
// spawns a child connection
func (s *Server) spawnChild(data []byte, conn *net.UDPConn, remoteAddr *net.UDPAddr) {

	conn2 := udp.Listen(":0")

	s.handleMsg(data, conn2, remoteAddr)

	go s.monitorChild(conn2)
}
Beispiel #2
0
func NewServer(listenAddr, rootDir string) *Server {
	s := &Server{
		clients: make(map[string]*Client),
		root:    rootDir,
	}

	s.Pconn = udp.Listen(listenAddr)

	return s
}