pushyrpc / pushy

Easy-as RPC. Zero-server RPC for Python and Java.
http://github.com/pushyrpc/pushy
45 stars 18 forks source link

InputStream from RemoteSocket.getInputStream functions differently to java.net.Socket's #28

Closed axw closed 12 years ago

axw commented 12 years ago

With an InputStream returned from java.net.Socket, a call to InputStream.read(byte[] buf, int offset, int length) may return less than the requested number of bytes. A RemoteSocket's InputStream will block until all "length" bytes are available.


Imported from Launchpad using lp2gh.

axw commented 12 years ago

(by axwalk) This is due to the use of socket.makefile, which acts like a Python file object, in that it does not return partial results. Rather than use socket.makefile, I'll have to create a new InputStream class which calls the socket.recv method.