diff options
author | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-04-05 16:36:03 +0200 |
---|---|---|
committer | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-04-05 16:36:03 +0200 |
commit | cfdde6b86b243cf412c1bb90e4e39de882d1c2e8 (patch) | |
tree | e45921a3d4b308c4bfc2f1f9499b0b95bf31ca8e /src/main/java/com/orbekk/protobuf/RpcChannel.java | |
parent | eb16cf212c75c81b8714308c7848887447aee33f (diff) |
Better server design.
Proper handling of asynchronous requests on the server.
Diffstat (limited to 'src/main/java/com/orbekk/protobuf/RpcChannel.java')
-rw-r--r-- | src/main/java/com/orbekk/protobuf/RpcChannel.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/com/orbekk/protobuf/RpcChannel.java b/src/main/java/com/orbekk/protobuf/RpcChannel.java index 90d4521..a4f1282 100644 --- a/src/main/java/com/orbekk/protobuf/RpcChannel.java +++ b/src/main/java/com/orbekk/protobuf/RpcChannel.java @@ -156,6 +156,9 @@ public class RpcChannel extends Thread implements Data.Response response; response = Data.Response.parseDelimitedFrom( socket.getInputStream()); + if (response == null) { + throw new IOException("No response."); + } finishRequest(response); } } catch (IOException e) { |