@ SuppressWarnings ( "checkstyle:illegalcatch" ) private boolean sendMessage ( final byte [ ] messageToSend ) { try { connectionPool . execute ( new PooledObjectConsumer < TcpConnection > ( ) { @ Override public void accept ( final TcpConnection tcpConnection ) throws IOException { tcpConnection . write ( messageToSend ) ; } } ) ; } catch ( final Exception e ) { addError ( String . format ( "Error sending message via tcp://%s:%s" , getGraylogHost ( ) , getGraylogPort ( ) ) , e ) ; return false ; } return true ; }
Send message to socket s output stream .