Protocol buffers gRPC中的示例不起作用

Protocol buffers gRPC中的示例不起作用,protocol-buffers,grpc,Protocol Buffers,Grpc,我试图运行路由示例,但当客户端开始连接到服务器时(blockingStub.getFeature(request)),它将挂起。若我停止客户端(在终端中ctrl+c),则会发生错误(请看下面) 有人知道可能出了什么问题吗 堆栈跟踪: 终端1服务器: ./gradlew routeGuideServer :grpc-core:compileJava UP-TO-DATE :grpc-core:animalSniffer ... May 06, 2015 4:56:06 PM io.grpc.exa

我试图运行路由示例,但当客户端开始连接到服务器时(
blockingStub.getFeature(request)
),它将挂起。若我停止客户端(在终端中ctrl+c),则会发生错误(请看下面)

有人知道可能出了什么问题吗

堆栈跟踪:

终端1服务器:

./gradlew routeGuideServer
:grpc-core:compileJava UP-TO-DATE
:grpc-core:animalSniffer
...
May 06, 2015 4:56:06 PM io.grpc.examples.routeguide.RouteGuideServer start
INFO: Server started, listening on 8980

// server is started; now running client
终端2客户端:

./gradlew routeGuideClient
:grpc-core:compileJava UP-TO-DATE
:grpc-core:animalSniffer
...
:grpc-examples:classes UP-TO-DATE
May 06, 2015 4:56:51 PM io.grpc.examples.routeguide.RouteGuideClient info
INFO: *** GetFeature: lat=409,146,138 lon=-746,188,906
// at this point everythings hangs
使用CTRL+C停止客户端将导致服务器中出现int错误

May 06, 2015 4:57:50 PM io.netty.channel.DefaultChannelPipeline$TailContext exceptionCaught
WARNING: An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.io.IOException: An existing connection was forcibly closed by the remote host
    at sun.nio.ch.SocketDispatcher.read0(Native Method)
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
    at sun.nio.ch.IOUtil.read(IOUtil.java:192)
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379)
    at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:311)
    at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:854)
    at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:242)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:115)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:510)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:467)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:381)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:703)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

这可能是一个错误;虽然客户端确实会进行一些睡眠,但没有理由挂起它。但我不能重现这个问题

服务器端的异常可能是相关的,因为客户端通常会正常关闭,而不会产生该异常。但是,如果客户机不正常地关闭了连接,那么您将收到该警告

我确实在grpc上看到了你昨天的留言-io@googlegroups.com,但没有机会回应。我创建了一个用于跟踪bug的程序