Skip to content

Instantly share code, notes, and snippets.

@dipeshdulal
Created July 12, 2020 03:40
Show Gist options
  • Save dipeshdulal/323a083956c84ac33c82210203f9564c to your computer and use it in GitHub Desktop.
Save dipeshdulal/323a083956c84ac33c82210203f9564c to your computer and use it in GitHub Desktop.
Server Listening code.
lis, err := net.Listen("tcp", "localhost:5400")
if err != nil {
log.Fatalf("Failed to listen: %v", err)
}
var opts []grpc.ServerOption
grpcServer := grpc.NewServer(opts...)
chatpb.RegisterChatServiceServer(grpcServer, &chatServiceServer{
channel: make(map[string][] chan *chatpb.Message),
}
grpcServer.Serve(lis)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment