Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NotYetConnectedException thrown while remote endpoint is not connected #31

Open
ingebot opened this issue Feb 6, 2012 · 1 comment
Open
Labels
bug Something isn't working

Comments

@ingebot
Copy link
Collaborator

ingebot commented Feb 6, 2012

Note: this issue was migrated automatically using bugzilla2github

Original bug ID: BZ#52135
From: mariusz <m.ryndzionek@a2s.pl>
Reported version: 0.98

@ingebot
Copy link
Collaborator Author

ingebot commented Feb 6, 2012

Comment author: mariusz <m.ryndzionek@a2s.pl>

Created attachment 26582
Simple test server and client

GCC: cross toochain - gcc-4.1.2, uClibc 0.9.28
GNU Classpath 0.98 (and CVS head) + JamVM (git HEAD)

The 'NotYetConnectedException' is thrown if the remote endpoint closes the connection. Reproducible using the attached testcase:

java TestServer
ONE
TWO
THREE
BYE
java TestClient
Sending: ONE
Sending: TWO
Sending: THREE
Sending: BYE
Sending: FOUR
java.nio.channels.NotYetConnectedException
   at gnu.java.nio.SocketChannelImpl.read(SocketChannelImpl.java:217)
   at gnu.java.net.PlainSocketImpl$SocketInputStream.read(PlainSocketImpl.java:587)
   at java.io.InputStream.read(InputStream.java:163)
   at java.io.InputStreamReader.read(InputStreamReader.java:459)
   at java.io.BufferedReader.fill(BufferedReader.java:370)
   at java.io.BufferedReader.readLine(BufferedReader.java:469)
   at TestClient.main(TestClient.java:45)

Java_gnu_java_nio_VMChannel_getpeername function returns 0 due to getpeername returning -1. SocketChannelImpl class isConnected is calling getpeername every time! I think it should buffer the connection state during connect() instead.

Attached file: testcase.tar.gz (application/x-gzip, 861 bytes)
Description: Simple test server and client

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant