function main() {
    const server = new grpc.Server();
    server.addService(services.GreeterService, { sayHello: sayHello });
    server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure());
    server.start();
    console.log('gRPC Node Server: Greeter server listening on port ');

    notifyReadyToClient('testpipe', (event, m) => {
        switch (event) {
        case 'close':
            console.log('gRPC Node Server: pipe closed: error=' + m);
            break;
        case 'error':
            console.log('gRPC Node Server: Pipe broken: ' + m.messages);
            break;
        default:
            console.log('gRPC Node Server: pipe: ' + event);
            break;
        }

        console.log('gRPC Node Server: Shutting down gRPC server...');
        server.forceShutdown();
        console.log('gRPC Node Server: Exit process.');
    });
}
/**
 * Starts an RPC server that receives requests for the Greeter service at the
 * sample server port
 */
Starts an RPC server that receives requests for the Greeter service at the
sample server port
Starts an RPC server that receives requests for the Greeter service at the sample server port
function main() {
    const server = new grpc.Server();
    server.addService(services.GreeterService, { sayHello: sayHello });
    server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure());
    server.start();
    console.log('gRPC Node Server: Greeter server listening on port ');
    notifyReadyToClient('testpipe', (event, m) => {
        switch (event) {
        case 'close':
            console.log('gRPC Node Server: pipe closed: error=' + m);
            break;
        case 'error':
            console.log('gRPC Node Server: Pipe broken: ' + m.messages);
            break;
        default:
            console.log('gRPC Node Server: pipe: ' + event);
            break;
        }
        console.log('gRPC Node Server: Shutting down gRPC server...');
        server.forceShutdown();
        console.log('gRPC Node Server: Exit process.');
    });
}
function main ( ) { const server = new grpc . Server ( ) ; server . addService ( services . GreeterService , { sayHello : sayHello } ) ; server . bind ( '0.0.0.0:50051' , grpc . ServerCredentials . createInsecure ( ) ) ; server . start ( ) ; console . log ( 'gRPC Node Server: Greeter server listening on port ' ) ; notifyReadyToClient ( 'testpipe' , ( event , m ) => { switch ( event ) { case 'close' : console . log ( 'gRPC Node Server: pipe closed: error=' + m ) ; break ; case 'error' : console . log ( 'gRPC Node Server: Pipe broken: ' + m . messages ) ; break ; default : console . log ( 'gRPC Node Server: pipe: ' + event ) ; break ; } console . log ( 'gRPC Node Server: Shutting down gRPC server...' ) ; server . forceShutdown ( ) ; console . log ( 'gRPC Node Server: Exit process.' ) ; } ) ; }
Starts an RPC server that receives requests for the Greeter service at the
 sample server port
Starts an RPC server that receives requests for the Greeter service at the sample server port