예제 #1
0
func main() {
	transportFactory := thrift.NewTTransportFactory()
	protocolFactory := thrift.NewTBinaryProtocolFactoryDefault()
	transport, _ := thrift.NewTServerSocket("localhost:9091")
	handler := server.NewAdServerHandler()
	processor := service.NewAdServletProcessor(handler)
	server := thrift.NewTSimpleServer4(processor, transport, transportFactory, protocolFactory)

	server.Serve()
}
예제 #2
0
func main() {
	transportFactory := thrift.NewTTransportFactory()
	protocolFactory := thrift.NewTBinaryProtocolFactoryDefault()
	socket, _ := thrift.NewTSocket("localhost:9091")
	transport := transportFactory.GetTransport(socket)
	transport.Open()
	client := service.NewAdServletClientFactory(transport, protocolFactory)
	req := reqInfo.NewReqInfo()
	req.SizeHight = 10
	client.Sender2(req)
}