Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4072256
Votes 2
Synopsis Win32 socket.accept() is not interruptible
Category java:classes_net
Reported Against 1.1.3 , 1.1.4 , 1.1.5
Release Fixed
State 11-Closed, duplicate of 4154947, request for enhancement
Priority: 5-Very Low
Related Bugs 4066000 , 4154947
Submit Date 15-AUG-1997
Description




This is the code that performs the interrupt():

   server.interrupt();         
   synchronized(sock) {
      try {
         sock.close();
      }
      catch(Exception e) {
         System.err.println("Error Closing Socket");
      }
   }

This is the code that it's interrupting:

   try {
      synchronized(sock) {
         while(true) {
            if(!gateways.empty())
                customer  = (HTTPGateway)gateways.remove();
            else {
                customer  = new HTTPGateway(this, kernel, props, keepalive, linger, timeout);
                customer .queueConnection();
            }
             customer .init(sock.accept());
         }
      }
   }
   catch(Exception e) {
      System.err.println("Service Interrupted");
   }

The interrupt should always be happening in the sock.accept()
statement but it doesn't. 
======================================================================
Work Around




None That I Can Think Of
======================================================================
Evaluation
Contingent upon the implementation of asynchronous I/O.
  xxxxx@xxxxx   2000-01-13

I am closing this bug as a duplicate of 4154947.
  xxxxx@xxxxx   2000-12-21
Comments
  
  Include a link with my name & email   

Submitted On 20-JAN-1998
davidholmes
No blocking I/O can be interrupted in JDK 1.1.x on any platform.


Submitted On 27-OCT-1998
bannor
David Holmes' comment is incorrect.  I have code
which interrupts blocking I/O under Solaris 
without a problem.
This bug is actually a duplicate of 4154947.


Submitted On 22-JUN-1999
dtr2
do sock.setSoTimeout(1000) for the ServerSocket, and check isInterrupted on
each loop.
NOTE: this causes an overhead (check isInterrupted() every 1000ms), but only
when the server is IDLE. if the server is working, the overhead is minimal
(calling isInterrupted() )



PLEASE NOTE: JDK6 is formerly known as Project Mustang