Skip to main content

Featured

Building a gRPC Service with Nested Messages, Repeated Fields, and Oneof in Python

Introduction:  gRPC is a high-performance, open-source framework developed by Google for building efficient and scalable distributed systems. It provides a language-agnostic way to define and implement services using Protocol Buffers (protobuf) as the interface definition language. In this tutorial, we'll explore how to build a gRPC service in Python that incorporates advanced features such as nested messages, repeated fields, and oneof. These features allow us to create complex data structures and handle scenarios where multiple values or mutually exclusive fields are involved.   Prerequisites: Basic understanding of gRPC and Protocol Buffers. Python development environment set up.   Step 1: Define the Protocol Buffers (protobuf) File  Start by defining the service and message definitions in a proto file. Here's an example of a proto file named example.proto that defines a gRPC service with nested messages, repeated fields, and oneof: syntax = "proto3" ; package

Node.js Port 3000 already in use but it actually isn't?

 

I have been working with a node.js project for a few weeks and it has been working great. Usually, I use npm start to run my app and view it in a browser on localhost, port 3000. Today, I started to get the following error while using npm start: Server started on port 3000 Port 3000 is already in us!?
 
And of course this happen with lot of other developer out there, so here is the solution. First make sure there no other app running on that port then we will 'kill' that process by using these command:
 
This single command line can kill the process running on given port.

npx kill-port 3000
 
To kill multiple ports.

npx kill-port 3000 8080 4200

 
if that's doesn't work, there is another solution. try:
For Linux/Mac OS search (sudo) run this in the terminal:

$ lsof -i tcp:3000
$ kill -9 PID


On Windows:

netstat -ano | findstr :3000
tskill typeyourPIDhere


change tskill for taskkill in git bash

 

Comments