/** * Close socket. * * @see #disconnect() */ protected void closeSocket() { if(isConnected()) { if (socket != null) { try { socket.close(); } catch (IOException x) { // Ignore } finally { socket = null; soOut = null; soIn = null; } } setRequestCount(0); setConnected(false); if (log.isDebugEnabled()) log.debug(sm.getString("IDataSender.closeSocket",getAddress().getHostAddress(), new Integer(getPort()),new Long(0))); } }
/** * Close socket. * * @see #disconnect() */ protected void closeSocket() { if(isConnected()) { if (socket != null) { try { socket.close(); } catch (IOException x) { // Ignore } finally { socket = null; soOut = null; soIn = null; } } setRequestCount(0); setConnected(false); if (log.isDebugEnabled()) log.debug(sm.getString("IDataSender.closeSocket",getAddress().getHostAddress(), new Integer(getPort()),new Long(0))); } }
/** * Close socket. * * @see #disconnect() */ protected void closeSocket() { if(isConnected()) { if (socket != null) { try { socket.close(); } catch (IOException x) { // Ignore } finally { socket = null; soOut = null; soIn = null; } } setRequestCount(0); setConnected(false); if (log.isDebugEnabled()) log.debug(sm.getString("bioSender.closeSocket",getAddress().getHostAddress(), Integer.valueOf(getPort()), Long.valueOf(0))); } }
/** * close socket * * @see DataSender#disconnect() * @see DataSender#closeSocket() */ protected void closeSocket() { if(isConnected()) { if (socket != null) { try { socket.close(); } catch (IOException x) { } finally { socket = null; soOut = null; soIn = null; } } setRequestCount(0); setConnected(false); if (log.isDebugEnabled()) log.debug(sm.getString("IDataSender.closeSocket",getAddress().getHostAddress(), new Integer(getPort()),new Long(0))); } }
soOut = socket.getOutputStream(); soIn = socket.getInputStream(); setRequestCount(0); setConnectTime(System.currentTimeMillis()); if (log.isDebugEnabled())
soOut = socket.getOutputStream(); soIn = socket.getInputStream(); setRequestCount(0); setConnectTime(System.currentTimeMillis()); if (log.isDebugEnabled())
soOut = socket.getOutputStream(); soIn = socket.getInputStream(); setRequestCount(0); setConnectTime(System.currentTimeMillis()); if (log.isDebugEnabled())
soOut = socket.getOutputStream(); soIn = socket.getInputStream(); setRequestCount(0); setConnectTime(System.currentTimeMillis()); if (log.isDebugEnabled())
/** * Send message. */ public void sendMessage(byte[] data, boolean waitForAck) throws IOException { IOException exception = null; setAttempt(0); try { // first try with existing connection pushMessage(data,false,waitForAck); } catch (IOException x) { SenderState.getSenderState(getDestination()).setSuspect(); exception = x; if (log.isTraceEnabled()) log.trace(sm.getString("IDataSender.send.again", getAddress().getHostAddress(),new Integer(getPort())),x); while ( getAttempt()<getMaxRetryAttempts() ) { try { setAttempt(getAttempt()+1); // second try with fresh connection pushMessage(data, true,waitForAck); exception = null; } catch (IOException xx) { exception = xx; closeSocket(); } } } finally { setRequestCount(getRequestCount()+1); keepalive(); if ( exception != null ) throw exception; } }
/** * Send message. */ public void sendMessage(byte[] data, boolean waitForAck) throws IOException { IOException exception = null; setAttempt(0); try { // first try with existing connection pushMessage(data,false,waitForAck); } catch (IOException x) { SenderState.getSenderState(getDestination()).setSuspect(); exception = x; if (log.isTraceEnabled()) log.trace(sm.getString("IDataSender.send.again", getAddress().getHostAddress(),new Integer(getPort())),x); while ( getAttempt()<getMaxRetryAttempts() ) { try { setAttempt(getAttempt()+1); // second try with fresh connection pushMessage(data, true,waitForAck); exception = null; } catch (IOException xx) { exception = xx; closeSocket(); } } } finally { setRequestCount(getRequestCount()+1); keepalive(); if ( exception != null ) throw exception; } }
setRequestCount(getRequestCount()+1); keepalive(); if ( exception != null ) throw exception;
setRequestCount(getRequestCount()+1); keepalive(); if ( exception != null ) throw exception;