// Init: init the proxy. create virtual device and assign ips, etc..
init the proxy. create virtual device and assign ips, etc
// Init : init the proxy . create virtual device and assign ips etc ..
func Init() {
	go func() {
		unused = make([]string, 0)
		addrByService = &addrTable{}
		metaClient = client.New()
		for {
			err := vdev.CreateDevice()
			if err == nil {
				break
			}
			klog.Warningf("[L4 Proxy] create Device is failed : %s", err)
			time.Sleep(2 * time.Second)
		}
		ipPoolSize = 0
		expandIpPool()
		ep, err := poll.CreatePoll(pollCallback)
		if err != nil {
			vdev.DestroyDevice()
			klog.Errorf("[L4 Proxy] epoll is open failed : %s", err)
			return
		}
		epoll = ep
		go epoll.Loop()
		klog.Infof("[L4 Proxy] proxy is running now")
	}()
}
func Init ( ) { go func ( ) { unused = make ( [ ] string , 0 ) addrByService = & addrTable { } metaClient = client . New ( ) for { err := vdev . CreateDevice ( ) if err == nil { break } klog . Warningf ( " " , err ) time . Sleep ( 2 * time . Second ) } ipPoolSize = 0 expandIpPool ( ) ep , err := poll . CreatePoll ( pollCallback ) if err != nil { vdev . DestroyDevice ( ) klog . Errorf ( " " , err ) return } epoll = ep go epoll . Loop ( ) klog . Infof ( " " ) } ( ) }
init the proxy.
init the proxy .
//create virtual network device //there may have some exception need to be fixed on OS //configure vir ip //open epoll