func StartAgent(incoming chan []byte, conn net.Conn) {
	hostid := atomic.AddInt32(&_host_genid, 1)
	log.Printf("game server [id:%v] connected\n", hostid)
	forward := make(chan IPCObject, 100000)
	protos.AddServer(hostid, forward)
	defer func() {
		protos.RemoveServer(hostid)
		core.LogoutServer(hostid)
		close(forward)
		log.Printf("game server [id:%v] disconnected\n", hostid)
	}()
	for {
		select {
		case msg, ok := <-incoming:  
			if !ok {
				return
			}
			reader := packet.Reader(msg)
			seqid, err := reader.ReadU32()
			if err != nil {
				log.Println("read SEQID failed.", err)
				return
			}
			ret := GSProxy(hostid, reader)
			if len(ret) != 0 {
				_send(seqid, ret, conn)
			}
		case obj := <-forward:  
			_send(0, obj.Json(), conn)
		}
	}
}
---------------------------------------------------------- HUB SERVICE
package main
import (
	"log"
	"net"
	"sync/atomic"
)
import (
	"hub/core"
	"hub/protos"
	"misc/packet"
	. "types"
)
var _host_genid int32
func init() {
	log.SetPrefix("[HUB] ")
}