The Source for Java Technology Collaboration

Home » java.net Forums » JDK » Java SE

Thread: JDK1.6.0_07 and _03: Non-blocking socket "oddity"

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 2 - Last Post: Apr 20, 2009 2:48 PM by: gluk Threads: [ Previous | Next ]
dave_raymer

Posts: 2
JDK1.6.0_07 and _03: Non-blocking socket "oddity"
Posted: Mar 30, 2009 12:00 PM
  Click to reply to this thread Reply

I have the following situation (on both Linux and MacOS) -- A non-blocking connection established to a server for a long-term persistent message oriented exchange (request-response). I'm doing negative testing and see something very odd (at least to my somewhat experienced "C" socket programming eyes).

When I pull the cable, the select does not wake up (this is good, and what what I expect). When I write to the socket while the cable is pulled, I expect to see an IOException, but I don't. When I plug the cable back in at the server, the select in the java application "breaks", and the recovery processing is initiated. So, is this normal expected behavior in Java? Shouldn't the SocketChannel.write( ByteBuffer src) call fail?

I've searched the forums and not found an answer to this -- if its already been answered, please point me to it, and provide the search you used to find it.

thanks and regards,

Dave

cowwoc

Posts: 1,055
Re: JDK1.6.0_07 and _03: Non-blocking socket "oddity"
Posted: Mar 31, 2009 1:10 PM   in response to: dave_raymer
  Click to reply to this thread Reply

I tend to agree. This behavior isn't what I expect.

gluk

Posts: 40
Re: JDK1.6.0_07 and _03: Non-blocking socket "oddity"
Posted: Apr 20, 2009 2:48 PM   in response to: dave_raymer
  Click to reply to this thread Reply

Your error might have already a solution at this site: http://iderror.com/category/errors/java/




 XML java.net RSS