grpc-go-course icon indicating copy to clipboard operation
grpc-go-course copied to clipboard

transport: Error while dialing dial tcp myserverIP:50051: i/o timeout

Open dineshr93 opened this issue 1 year ago • 3 comments

I have developed a unary grpc service that gets the ipaddress and number from client and returns the square of that number. If I host the service in localhost the client is able to access those service and prints the output (square of the input number)

Now I hosted the server side binary in a real separate server(linux) and trying to access that service via my local client(windows).

But when I try to access the service from client it waits for sometime and throws "transport: Error while dialing dial tcp myserverIP:50051: i/o timeout" error

I am able to ping the server from client and it is working fine!

precise steps are

step1: (client side) #Windows local machine #updated the ssl.sh script, cn to myserverIP(ip address of my linux server) and generated the crt and pem files

step2: (server side) server.crt & server.pem files are copied from client side #linux OS with specific myserverIP

>./server myserverIP:50051
2023/07/11 15:26:38 Listening at myserverIP:50051

step3: (client side-windows) ca.crt file is already generated

>client.exe myserverIP:50051 5  # adapted to get ip address from user as a 1st parameter and number to be squared as 2nd param
2023/07/11 13:58:23 Could not square the number: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp myserverIP:50051: i/o timeout"

Please may I have your help in resolving the connection issue?

dineshr93 avatar Jul 11 '23 14:07 dineshr93