From the course: Beginner's Guide to Go Protocol Buffer

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Solution 2: Part 2

Solution 2: Part 2

- [Instructor] And now in our function main, we're going to add in the stuff to get the server running. So first we have to create the listen, the port, so we have that listen, the TCP. And we're going to do localhost 9008. Next we're going to check if there's an error and if there is an error, we're going to log a fatal error. We're going to say that fail to listen I'm going to return the error. But if all works, we're going to create the options variable but we're not going to actually use any, we'll just do the default. So we have grpcServer which will be grpcNewServer with options. And then we're going to call to register the character service server. We'll send in the grpcServer and we'll call the command to create the server the character service server. And after that we're going to print out gRPC Server started and listening on port 9008. And then we're going to have grpcServer start. And that is the server.…

Contents