- All Known Subinterfaces:
- ContentConnection, DatagramConnection, HttpConnection, InputConnection, OutputConnection, StreamConnection, StreamConnectionNotifier
- See Also:
- Top Examples, Source Code
public void close()
throws IOException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[1906]open and return a connection
By iqueen on 2007/08/02 23:39:53 Rate
private static final int CONN_RETRY = 3;
private Connection connection;
private Connection openConn ( String URL ) throws IOException {
this.connection = null;
for ( int i = 0; i < CONN_RETRY; i++ ) {
try {
connection = Connector.open ( URL ) ;
this.connected = true;
break;
} catch ( ConnectionNotFoundException e ) {
appendLog ( e ) ;
throw e;
} catch ( SecurityException e ) {
appendLog ( e ) ;
break;
}
}
return connection;
}
public void appendLog ( Exception es ) {
//TODO handle exception
}