@ Override protected void sendToNode ( Message message , short node , InetSocketAddress address ) { try { if ( LOG . isDebugEnabled ( ) ) LOG . debug ( "Sending to node {} ({}): {}" , new Object [ ] { node , address , message } ) ; message . cloneDataBuffers ( ) ; // important, as we're going to be doing actual sending on another thread final NodePeer peer = peers . get ( node ) ; if ( peer == null ) throw new NodeNotFoundException ( node ) ; peer . sendMessage ( message ) ; executor . submit ( peer ) ; } catch ( InterruptedException ex ) { LOG . error ( "InterruptedException" , ex ) ; throw new RuntimeException ( ex ) ; } catch ( Exception ex ) { LOG . error ( "Error while sending message " + message + " to node " + node , ex ) ; } }
Can block if buffer is full