func runFakeRender(addr string) { var tTS fakeRender processor := gopnikrpc.NewRenderProcessor(&tTS) transport, err := thrift.NewTServerSocket(addr) if err != nil { panic(err) } transportFactory := thrift.NewTFramedTransportFactory(thrift.NewTTransportFactory()) protocolFactory := thrift.NewTBinaryProtocolFactoryDefault() server := thrift.NewTSimpleServer4(processor, transport, transportFactory, protocolFactory) if err = server.Serve(); err != nil { panic(err) } }
func RunServer(addr string, tileServer *TileServer) error { tTS := &thriftTileServer{ tileServer: tileServer, Service: rpcbaseservice.NewService(), } processor := gopnikrpc.NewRenderProcessor(tTS) transport, err := thrift.NewTServerSocket(addr) if err != nil { return err } transportFactory := thrift.NewTFramedTransportFactory(thrift.NewTTransportFactory()) protocolFactory := thrift.NewTBinaryProtocolFactoryDefault() server := thrift.NewTSimpleServer4(processor, transport, transportFactory, protocolFactory) return server.Serve() }