I am having a really difficult time communicating with a gRPC Server that I deployed on Herkou.
Here is how I am listening on the gRPC Server with NodeJS:
server.js
init() {
let grpcServer = new grpc.Server();
grpcServer.addService(services.LocationManagementService, LocationManager);
grpcServer.bindAsync('0.0.0.0:50051', grpc.ServerCredentials.createInsecure(), () => {
grpcServer.start();
console.log("GRPC Server Started");
});
}
Where LocationManager.js
is as below
const LocationManager = {
updateLocation: (call, callback) => {
console.log("The Location Update Function Has Being called");
let locationUpdateResponse = new messages.LocationDataResponse();
let request = call.request;
let authParams = request.getAuthParams();
let locationUpdateTarget = request.getLocationUpdateTarget();
},
queryLocation: (call, callback) => {
let locationQueryResponse = new messages.LocationDataResponse();
}
}
module.exports = LocationManager;
Generated the Client Libraries for Flutter and Used as below:
static ClientChannel clientChannel() {
return ClientChannel(
myappname.herokuapp.com,
port:50051,
options: ChannelOptions(
credentials: ChannelCredentials.insecure(),
),
);
}
LocationManagementClient locationManagementClient =
LocationManagementClient(clientChannel());
But all I keep getting is:
gRPC Error (code: 14, codeName: UNAVAILABLE, message: Error connecting: SocketException: OS Error: Connection timed out, errno = 110, address = myappname.herokuapp.com, port = 32788, details: null, rawResponse: null)
Any insights would be greatly appreciated.
Thank you.