Beispiel #1
0
func main() {
	handler := UserServicerHandler{}
	processor := shared.NewBinaryMessengerProcessor(handler)
	//addr := beego.AppConfig.String("socketAddress")
	addr := "localhost:3001"

	var transport thrift.TServerTransport
	var err error

	if transport, err = thrift.NewTServerSocket(addr); err != nil {
		panic(err)
		//panic("Unable to initialize socket!")
	}

	transportFactory := thrift.NewTTransportFactory()
	protocolFactory := thrift.NewTBinaryProtocolFactoryDefault()

	server := thrift.NewTSimpleServer4(processor, transport, transportFactory, protocolFactory)
	fmt.Printf("server started on %v\n", addr)
	server.Serve()
}
Beispiel #2
0
func NewUserServicerProcessor(handler UserServicer) *UserServicerProcessor {
	self0 := &UserServicerProcessor{shared.NewBinaryMessengerProcessor(handler)}
	return self0
}