}
// Close socket and its streams.
public void close_() throws SqlException {
// can we just close the socket here, do we need to close streams individually
SqlException accumulatedExceptions = null;
if (rawSocketInputStream_ != null) {
try {
rawSocketInputStream_.close();
} catch (java.io.IOException e) {
// note when {6} = 0 it indicates the socket was closed.
// this should be ok since we are going to go an close the socket
// immediately following this call.
// changing {4} to e.getMessage() may require pub changes
accumulatedExceptions = new SqlException(logWriter_,
new ClientMessageId(SQLState.COMMUNICATION_ERROR),
e.getMessage(), e);
} finally {
rawSocketInputStream_ = null;
}
}
if (rawSocketOutputStream_ != null) {
try {
rawSocketOutputStream_.close();
} catch (java.io.IOException e) {
// note when {6} = 0 it indicates the socket was closed.
// this should be ok since we are going to go an close the socket
// immediately following this call.
// changing {4} to e.getMessage() may require pub changes
SqlException latestException = new SqlException(logWriter_,
new ClientMessageId(SQLState.COMMUNICATION_ERROR),
e.getMessage(), e);
accumulatedExceptions = Utils.accumulateSQLException(latestException, accumulatedExceptions);
} finally {
rawSocketOutputStream_ = null;
}
}
if (socket_ != null) {
try {
socket_.close();
} catch (java.io.IOException e) {
// again {6} = 0, indicates the socket was closed.
// maybe set {4} to e.getMessage().
// do this for now and but may need to modify or
// add this to the message pubs.
SqlException latestException = new SqlException(logWriter_,
new ClientMessageId(SQLState.COMMUNICATION_ERROR),
e.getMessage(), e);
accumulatedExceptions = Utils.accumulateSQLException(latestException, accumulatedExceptions);
} finally {
socket_ = null;