We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea2e91b commit 361953fCopy full SHA for 361953f
grpc/rpc.go
@@ -5,6 +5,7 @@ import (
5
"io"
6
"log"
7
"net"
8
+ "os"
9
"strings"
10
11
builder "github.com/arduino/arduino-builder"
@@ -193,10 +194,13 @@ func newServer(ctx *types.Context, watcher *fsnotify.Watcher) *builderServer {
193
194
}
195
196
func RegisterAndServeJsonRPC(ctx *types.Context) {
-
197
+ lis, err := net.Listen("tcp", "localhost:12345")
198
+ if err != nil {
199
+ //can't spawn two grpc servers on the same port
200
+ os.Exit(0)
201
+ }
202
watcher := startWatching(ctx)
203
- lis, _ := net.Listen("tcp", "localhost:12345")
204
grpcServer := grpc.NewServer()
205
pb.RegisterBuilderServer(grpcServer, newServer(ctx, watcher))
206
grpcServer.Serve(lis)
0 commit comments