node.js - grpc, two clients connect to the server at one time return error -
i wrote simple chat room demo grpc lib, 1 client can connect server @ 1 time, weird. here code, can give advise on it?
client:
const chat_proto = grpc.load(__dirname + '/chat.proto').demo; const client = new chat_proto.chat('localhost:50051'); server:
let chatserver = getservice(); chatserver.bind('localhost:50051'); chatserver.listen(); chat.proto:
syntax = "proto3"; package demo; service chat { rpc sayhi(username) returns (welmessage) {} rpc chatwith(stream chatnote) returns (stream chatnote) {} } message username { string name = 1; } message welmessage { string message = 1; } message chatnote { string message = 1; } error:
- client return
error @ /users/chopper/webstormprojects/grpcexamples/node_modules/grpc/src/client.js:461:23means response.status.code !== grpc.status.ok - server return
segmentation fault: 11
Comments
Post a Comment