xiaoshua / junixsocket

Automatically exported from code.google.com/p/junixsocket
0 stars 0 forks source link

Inpustream don't implement the available() function #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Introduction :

Before explaining this issue, i would like to thank the author for this work.

I'm planning using junixsocket to communicate with nodeJs by a better way
(in term of performance) than TCP socket.

The problem : 

I'm using InputStream.available() for my needs.
The commons-apache-io use this function too with IOUtils.xxx()

But this function isn't implemented.

What steps will reproduce the problem?

-> socket.getInputStream().available()

What is the expected output? What do you see instead?

-> The expected output must return the amount of available bytes from socket.

What version of the product are you using? On what operating system?

-> All

Please provide any additional information below.

-> You should see ioctl.h to get an idea to implement this function.

Jean-Vincent LEROY

Original issue reported on code.google.com by jv.le...@gmail.com on 23 Apr 2010 at 12:01

GoogleCodeExporter commented 9 years ago
Hi Jean-Vincent,

thanks for reporting!
I have added support for InputStream#available. It is in SVN trunk, including a 
junit
testcase.

Could you please test if it works for you?

Best,
Christian

PS: The following statement is not correct according the Java Socket API.
> The expected output must return the amount of available bytes from socket.
This is not correct. It MAY return it, or any number down to zero. In the
implementation up to junixsocket 1.2, zero was always returned.

Original comment by ckkohl79 on 23 Apr 2010 at 8:08

GoogleCodeExporter commented 9 years ago
Thank you for quick response !
I made some tests with your modifications and it's ok for me.

Good work :)

Original comment by jv.le...@gmail.com on 23 Apr 2010 at 12:01

GoogleCodeExporter commented 9 years ago
Great to hear!

Cheers,
Christian

Original comment by ckkohl79 on 23 Apr 2010 at 12:08