Пример #1
0
Файл: user.go Проект: mvpmvh/DE2
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()
}
Пример #2
0
func NewUserServicerProcessor(handler UserServicer) *UserServicerProcessor {
	self0 := &UserServicerProcessor{shared.NewBinaryMessengerProcessor(handler)}
	return self0
}