Skip to content

Commit

Permalink
Added greet client
Browse files Browse the repository at this point in the history
1. added greet client main.go
2. run, make clean; make greet
3. in one tab run,  ./bin/greet/server
4. in other tab run, ./bin/greet/client
  • Loading branch information
nik-hil committed Aug 1, 2022
1 parent 1e3416c commit 9f130d4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions greet/client/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package main

import (
"log"

"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

var addr string = "localhost:50051"

func main() {
conn, err := grpc.Dial(addr, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
log.Fatalf("Failed to create connection: %v\n", err)
}
log.Println("Connected")
defer conn.Close()
}

0 comments on commit 9f130d4

Please sign in to comment.