package main
import (
"fmt"
"os"
"taochees"
"thrift"
"strconv"
)
type TestServiceImpl struct {
}
var objService = new(xxxx)
func (this *TestServiceImpl) SearchData(param xxxx) (r xxxx, err error) {
if err != nil {
// Handle error
fmt.Println(err)
return nil, err
}
fmt.Println("接收请求...")
r, err = objSearchService.SearchData(*param)
return r, err
}
func main() {
transportFactory := thrift.NewTTransportFactory()
protocolFactory := thrift.NewTBinaryProtocolFactory(false, false)
serverTransport, err := thrift.NewTServerSocket("172.17.1.1:7912")
if err != nil {
fmt.Println("Error!", err)
os.Exit(1)
}
handler := &TaocheESServiceImpl{}
processor := taochees.NewTaocheESServiceProcessor(handler)
server := thrift.NewTSimpleServer4(processor, serverTransport, transportFactory, protocolFactory)
fmt.Println("thrift server start...")
server.Serve()
}