Send an audit message to a designated destination address and port using the
TLS socket specified.

@param msg         Message to send
@param destination TLS socket to use
@throws Exception
550217
private void send(AuditEventMessage msg, Destination<S> destination) throws Exception {
        if (EventUtils.isEmptyOrNull(msg)) {
            return;
        }
        // Serialize and format event message for syslog
        byte[] msgBytes = getTransportPayload(msg);
        if (EventUtils.isEmptyOrNull(msgBytes)) {
            return;
        }
        destination.write(msgBytes);
    }
724690
public void send(String msg) {
    try {
      Socket socket = new Socket(graphiteHost, graphitePort);

      try {
        Writer writer = new OutputStreamWriter(socket.getOutputStream());
        try {
          writer.write(msg);
          writer.flush();
        } finally {
          try {
            writer.close();
          } catch (IOException ioe) {
            //ignore, we want to see the outer exception if any
            LOGGER.info("could not close writer");
          }
        }
        if (connectionState != ConnectionState.SUCCESS) {
          LOGGER.info("Connection to graphite Host {}",
            ((connectionState == ConnectionState.UNKNOWN) ? "established" : "recovered"));
          connectionState = ConnectionState.SUCCESS;
        }

      } catch (IOException e) {
        String action = "write";
        handleException(e, action);
      } finally {
        socket.close();
      }
    } catch (IOException e) {
      String action = "connect";
      handleException(e, action);
    }
  }
1303908
public void checkin(SocketDestination destination, SocketAndStreams socket) {
        try {
            pool.checkin(destination, socket);
        } catch(Exception e) {
            throw new VoldemortException("Failure while checking in socket for " + destination
                                         + ": ", e);
        }
    }
233760
def sendMessage(self, msg):
        
        if msg._messageType in (1, 2):
            assert msg.destination, 'Failed to specify a message destination'

        if msg.destination is not None:
            if msg.destination[0] == ':':
                p = self.clients.get(msg.destination, None)
            else:
                p = self.busNames.get(msg.destination, None)
                if p:
                    p = p[0]

            # print 'SND: ', msg._messageType, ' to ',  p.uniqueName, 'serial',
            # msg.serial,

            if p:
                p.sendMessage(msg)
            else:
                log.msg(
                    'Invalid bus name in msg.destination: '
                    + msg.destination
                )
        else:
            self.router.routeMessage(msg)
802802
private void send(AuditEventMessage msg, Socket socket) throws Exception
	{
		if (EventUtils.isEmptyOrNull(msg)) {
			return;
		}
		
		// Serialize and format event message for syslog
		byte[] msgBytes = getTransportPayload(msg);
		if (EventUtils.isEmptyOrNull(msgBytes)) {
			return;
		}

		//TODO: prepend the SYSLOG-FRAME, which is just the length of msgBytes with no leading zeros followed by a space
		String syslogFrame = String.valueOf(msgBytes.length) + " ";
		
		//TODO: send the frame + message over the socket
       if (LOGGER.isDebugEnabled()) {
        	LOGGER.debug("Auditing to " + socket.getInetAddress().getHostAddress() + ":" + socket.getPort());
        	LOGGER.debug(new String(msgBytes));
       }

       // multiple threads can get a pointer to the socket but only one should write at a time
       synchronized (socket){
    	   try{
		       OutputStream out = socket.getOutputStream();
		       out.write(syslogFrame.getBytes());
		       out.write(msgBytes);
		       out.flush();
    	   } catch(SocketException e) {
    		   try {
	    		   LOGGER.info("Failed to connect with existing TLS socket.  Will create a new connection and retry.");
	    		   String key = socket.getInetAddress().getHostAddress() + ":" + socket.getPort();
	    		   synchronized (socketMap) {
	    			   socketMap.remove(key);
		    		   Socket newSocket = this.getTLSSocket(socket.getInetAddress(), socket.getPort());
				       OutputStream out = newSocket.getOutputStream();
				       out.write(syslogFrame.getBytes());
				       out.write(msgBytes);
				       out.flush();
				       socketMap.put(key, newSocket);
	    		   }
    		   } catch (Exception exception) {
	    		   LOGGER.error("Still exception trying to audit to TLS socket, throwing away socket.  Cannot connect to server, this log message will be lost.", e);
	    		   synchronized (socketMap) {
	    			   // since we don't know what the key was for this socket, just dump the whole map cause something is probably gone wrong anyway
	    			   for(Socket closeMe : socketMap.values()){
	    				   try{
	    					   closeMe.close();
	    				   }catch (Exception ex){
	    					   // nothing we can do about this, ignore it
	    				   }
	    			   }
	    			   socketMap.clear();
	    		   }    			   
	    		   // rethrow the exception so caller knows what happened
	    		   throw e;
    		   }
    		   
    	   }
       }
	}
506359
private void send(final byte[] buffer, final Session destination) {
        synchronized (connections) {
            // execute asynchronously to avoid slower clients from interfering with faster clients
            final ExecutorService connectionThread = connectionThreads.get(destination);
            if (connectionThread == null) {
                // Maybe the client has disconnected in the mean time.
                return;
            }
            connectionThread.execute(new Runnable() {
                @Override
                public void run() {
                    try {
                        // for the case that the runnable was committed shortly before the connection was closed.
                        if (destination.isOpen()) {
                            // FIXME replace with getAsyncRemote and removeconnectionThreads as soon as
                            // getAsyncRemote on tomcat is thread-safe
                            destination.getBasicRemote().sendBinary(ByteBuffer.wrap(buffer));
                        }
                    } catch (final IOException e) {
                        try {
                            if (destination.isOpen()) {
                                destination.close(new CloseReason(CloseCodes.PROTOCOL_ERROR, "Failed to send data."));
                            }
                        } catch (final IOException e1) {
                            // The outer exception already indicated that something went wrong.
                            ignore(e1);
                        }
                        handleClientError(destination, e);
                        connectionCloses(destination);
                    }
                }
            });
        }
    }
623357
public void sendMessage(byte[] msgdata, boolean isActivity)
			throws SshException {

		synchronized (kexqueue) {

			if (currentState == PERFORMING_KEYEXCHANGE
					&& !isTransportMessage(msgdata[0])) {
				kexqueue.addElement(msgdata);
				return;
			}

			if (Log.isDebugEnabled()) {
				if (verbose) {
					Log.debug(this,
							"Sending transport protocol message");
				}
			}

			try {
				outgoingMessage.reset();

				int padding = 4;

				// Compress the payload if necersary
				if (outgoingCompression != null && isOutgoingCompressing) {
					msgdata = outgoingCompression.compress(msgdata, 0,
							msgdata.length);
				}

				// Determine the padding length
				padding += ((outgoingCipherLength - ((msgdata.length + 5 + padding) % outgoingCipherLength)) % outgoingCipherLength);

				// Write the packet length field
				outgoingMessage.writeInt(msgdata.length + 1 + padding);

				// Write the padding length
				outgoingMessage.write(padding);

				// Write the message payload
				outgoingMessage.write(msgdata, 0, msgdata.length);

				// Create some random data for the padding
				ComponentManager
						.getInstance()
						.getRND()
						.nextBytes(outgoingMessage.array(),
								outgoingMessage.size(), padding);
				outgoingMessage.move(padding);

				// Generate the MAC
				if (outgoingMac != null) {
					outgoingMac.generate(outgoingSequence,
							outgoingMessage.array(), 0, outgoingMessage.size(),
							outgoingMessage.array(), outgoingMessage.size());

				}

				// Perfrom encrpytion
				if (encryption != null) {
					encryption.transform(outgoingMessage.array(), 0,
							outgoingMessage.array(), 0, outgoingMessage.size());
				}

				outgoingMessage.move(outgoingMacLength);
				outgoingBytes += outgoingMessage.size();

				// Send!
				transportOut.write(outgoingMessage.array(), 0,
						outgoingMessage.size());
				transportOut.flush();

				if (isActivity)
					lastActivity = System.currentTimeMillis();

				if (Log.isDebugEnabled()) {
					if (verbose) {
						Log.debug(
								this,
								"Sent "
										+ outgoingMessage.size()
										+ " bytes of transport data outgoingSequence="
										+ outgoingSequence
										+ " totalBytesSinceKEX="
										+ numOutgoingBytesSinceKEX);
					}
				}

				outgoingSequence++;
				numOutgoingBytesSinceKEX += msgdata.length;
				numOutgoingPacketsSinceKEX++;

				if (outgoingSequence >= 4294967296L) {
					outgoingSequence = 0;
				}

				if (!transportContext.isKeyReExchangeDisabled()) {
					if (numOutgoingBytesSinceKEX >= MAX_NUM_BYTES_BEFORE_REKEY
							|| numOutgoingPacketsSinceKEX >= MAX_NUM_PACKETS_BEFORE_REKEY) {

						if (Log.isDebugEnabled()) {
							Log.debug(this,
									"Requesting key re-exchange");
						}
						sendKeyExchangeInit(false);
					}
				}
			} catch (IOException ex) {
				internalDisconnect();
				throw new SshException("Unexpected termination: "
						+ ex.getMessage(), SshException.UNEXPECTED_TERMINATION);
			}
		}

	}
1012196
@Override
	protected final void sendToDestination(Destination destination, boolean destinationOverride, Message srcMessage, int deliveryMode, int priority, long timeToLive) throws JMSException
    {
        // Check that the destination was specified
        if (destination == null)
            throw new InvalidDestinationException("Destination not specified");  // [JMS SPEC]

        // Create an internal copy if necessary
        AbstractMessage message = MessageTools.makeInternalCopy(srcMessage);
        
        externalAccessLock.readLock().lock();
        try
		{
    		checkNotClosed();
    		
	        // Dispatch to session
            ((LocalSession)session).dispatch(message);
		}
        finally
        {
        	externalAccessLock.readLock().unlock();
        }
    }
837648
protected byte[] getTransportPayload(AuditEventMessage msg)
	{
		if (msg == null) {
			return null;
		}
		
		byte[] msgBytes = msg.getSerializedMessage(false);
		if (EventUtils.isEmptyOrNull(msgBytes)) {
			return null;
		}
		
		// Format message with transport-specific headers
		StringBuilder sb = new StringBuilder();
		sb.append("<");
		sb.append(TRANSPORT_DEFAULT_PRIORITY);
		sb.append(">");
		
		sb.append(TimestampUtils.getBSDSyslogDate(msg.getDateTime()));
		sb.append(" ");
		sb.append(getSystemHostName());
		sb.append(" ");
		sb.append("<?xml version=\"1.0\" encoding=\"ASCII\"?>");
		sb.append(new String(msgBytes));

		return sb.toString().trim().getBytes();
	}
895192
protected void sendNonTransacted(Destination destination, Serializable message) {
        send(destination, message, null, null, false);
    }
1216467
public void sendMessage(Message message) throws RemoteException
    {
        BaseTransport transport = this.createProxyTransport(SEND_MESSAGE);
        transport.addParam(MESSAGE, message);   // Don't use COMMAND
        transport.sendMessageAndGetReply();
    }
942697
public void trace( String msg, Throwable t )
    {
        if( m_delegate.isTraceEnabled() )
        {
            m_delegate.trace( msg, t );
        }
    }
1286498
public void sendMessage(ISUPMessage msg, int dpc) throws ParameterException, IOException {
        if (!msg.hasAllMandatoryParameters()) {
            throw new ParameterException("Message does not have all required parameters!");
        }
        sendOnCircuit(getCircuit(msg, dpc), msg);
    }
1356223
private void localPut(
                          MessageItem msg,
                          TransactionCommon transaction)
                    throws
                    SIIncorrectCallException,
                    SIResourceException,
                    SINotPossibleInCurrentConfigurationException,
                    SINotAuthorizedException,
                    SILimitExceededException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(
                        tc,
                        "localPut",
                        new Object[] { msg, transaction });

        boolean stored = false;

        /*
         * If a non-empty frp exists at this point then send the message to the exception
         * destination
         */
        if (!msg.getMessage().isForwardRoutingPathEmpty())
        {
            // If we have a non-empty forward routing path then throw an exception. 
            // A topicspace can only be the final element in the path.

            SIMPIncorrectCallException e = new SIMPIncorrectCallException(
                            nls.getFormattedMessage(
                                                    "FORWARD_ROUTING_PATH_ERROR_CWSIP0249",
                                                    new Object[] { _destination.getName(),
                                                                  _messageProcessor.getMessagingEngineName() },
                                                    null));

            e.setExceptionReason(SIRCConstants.SIRC0037_INVALID_ROUTING_PATH_ERROR);
            e.setExceptionInserts(new String[] { _destination.getName(),
                                                _messageProcessor.getMessagingEngineName(),
                                                "unknown",
                                                SIMPUtils.getStackTrace(e) });

            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            {
                SibTr.exception(tc, e);
                SibTr.exit(tc, "localPut", e);
            }

            throw e;

        }

        // If the message came in from a remote bus then
        // check whether the userId is authorised to access this destination
        if (msg.isFromRemoteBus())
        {
            // Check whether bus security is enabled 
            if (_messageProcessor.isBusSecure())
            {
                JsMessage jsMsg = msg.getMessage();

                // Before we test for anything else, see whether this message 
                // was sent by the privileged Jetstream SIBServerSubject. If it was
                // then we bypass the security checks
                if (!_messageProcessor.getAuthorisationUtils().sentBySIBServer(jsMsg))
                {
                    // Check authority to produce to destination
                    String userid = null;
                    if (_destination.isLink() && !_destination.isMQLink())
                    {
                        userid = ((LinkHandler) _destination).getInboundUserid();
                    }

                    // If the InboundUserid is null or we're not working with a link
                    // Set the userid from the message
                    if (userid == null)
                    {
                        // Use the id extracted from the message for access checks
                        userid = jsMsg.getSecurityUserid();
                    }

                    // Defect 240261: Map a null userid to an empty string
                    if (userid == null)
                    {
                        userid = ""; // Empty string means those users that have not
                                     // been authenticated, but who are still, of course,
                                     // members of EVERYONE. 
                    }

                    String discriminator = msg.getMessage().getDiscriminator();

                    // Create secContext from userid and discriminator
                    SecurityContext secContext = new SecurityContext(userid, discriminator);

                    if (!_destination.checkDestinationAccess(secContext,
                                                             OperationType.SEND))
                    {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                            SibTr.exit(tc, "localPut", "not authorized to produce to this destination");

                        // Build the message for the Exception and the Notification
                        String nlsMessage =
                                        nls_cwsik.getFormattedMessage("DELIVERY_ERROR_SIRC_18", // USER_NOT_AUTH_SEND_ERROR_CWSIP0306
                                                                      new Object[] { _destination.getName(),
                                                                                    userid },
                                                                      null);

                        // Fire a Notification if Eventing is enabled
                        _messageProcessor.
                                        getAccessChecker().
                                        fireDestinationAccessNotAuthorizedEvent(_destination.getName(),
                                                                                userid,
                                                                                OperationType.SEND,
                                                                                nlsMessage);

                        // Thrown if user denied access to destination
                        SIMPNotAuthorizedException e = new SIMPNotAuthorizedException(nlsMessage);

                        e.setExceptionReason(SIRCConstants.SIRC0018_USER_NOT_AUTH_SEND_ERROR);
                        e.setExceptionInserts(new String[] { _destination.getName(),
                                                            userid });
                        throw e;
                    }

                    if (!_destination.
                                    checkDiscriminatorAccess(secContext,
                                                             OperationType.SEND))
                    {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                            SibTr.exit(tc, "localPut", "not authorized to produce to this destination's discriminator");

                        // Write an audit record if access is denied
                        SibTr.audit(tc, nls_cwsik.getFormattedMessage(
                                                                      "DELIVERY_ERROR_SIRC_20", // USER_NOT_AUTH_SEND_ERROR_CWSIP0308
                                                                      new Object[] { _destination.getName(),
                                                                                    secContext.getDiscriminator(),
                                                                                    userid },
                                                                      null));

                        // Thrown if user denied access to destination 
                        SIMPNotAuthorizedException e = new SIMPNotAuthorizedException(
                                        nls_cwsik.getFormattedMessage(
                                                                      "DELIVERY_ERROR_SIRC_20", // USER_NOT_AUTH_SEND_ERROR_CWSIP0308
                                                                      new Object[] { _destination.getName(),
                                                                                    secContext.getDiscriminator(),
                                                                                    userid },
                                                                      null));

                        e.setExceptionReason(SIRCConstants.SIRC0020_USER_NOT_AUTH_SEND_ERROR);
                        e.setExceptionInserts(new String[] { _destination.getName(),
                                                            secContext.getDiscriminator(),
                                                            userid });
                        throw e;
                    }
                }
            }
        }

        boolean forcePut = msg.isForcePut();
        // Check SendAllowed for local case.
        //send allowed can be false ONLY if this msg is not force put
        boolean isSendAllowed = forcePut ||
                                (_itemStream.isSendAllowed() && _destination.isSendAllowed());

        if (!isSendAllowed)
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(
                           tc,
                           "localPut",
                           "Destination send disallowed");

            SIMPNotPossibleInCurrentConfigurationException e = new SIMPNotPossibleInCurrentConfigurationException(
                            nls.getFormattedMessage("DESTINATION_SEND_DISALLOWED_CWSIP0253",
                                                    new Object[] { _destination.getName(),
                                                                  _messageProcessor.getMessagingEngineName() }, null));

            e.setExceptionReason(SIRCConstants.SIRC0901_INTERNAL_MESSAGING_ERROR);
            e.setExceptionInserts(new String[] { "com.ibm.ws.sib.processor.impl.PubSubInputHandler.localPut",
                                                "1:1334:1.329.1.1",
                                                SIMPUtils.getStackTrace(e) });
            throw e;
        }

        // check total items on itemstream not exceeded (allow extra 1 for ref stream)
        //but only if forcePut==false
        long topicSpaceHighLimit = _destination.getPublishPoint().getDestHighMsgs();
        if (!forcePut &&
            ((topicSpaceHighLimit != -1)
            && (_itemStream.getTotalMsgCount() >= topicSpaceHighLimit)
            ))
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(
                           tc,
                           "localPut",
                           "Destination reached high limit");

            SIMPLimitExceededException e = new SIMPLimitExceededException(
                            nls.getFormattedMessage("DESTINATION_HIGH_MESSAGES_ERROR_CWSIP0251",
                                                    new Object[] { _destination.getName(),
                                                                  new Long(topicSpaceHighLimit),
                                                                  _messageProcessor.getMessagingEngineName() },
                                                    null));
            e.setExceptionReason(SIRCConstants.SIRC0025_DESTINATION_HIGH_MESSAGES_ERROR);
            e.setExceptionInserts(new String[] { _destination.getName(),
                                                new Long(topicSpaceHighLimit).toString() });
            throw e;
        }

        if (msg.isTransacted())
        {
            // Dont store the msg till pre-prepare when we know if there are any
            // subscribers.  For now, just register for the pre-prepare callback on
            // the transaction.  //183715.1
            registerMessage(msg, transaction); //183715.1      
        }
        else
        {
            LocalTransaction siTran = _txManager.createLocalTransaction(false);

            // If COD reports are required, register for the precommit callback
            if (msg.getReportCOD() != null && _destination instanceof BaseDestinationHandler)
                msg.registerMessageEventListener(MessageEvents.COD_CALLBACK, (BaseDestinationHandler) _destination);

            try
            {
                // Perform the PubSub match.
                stored = localFanOut(msg, siTran, false);

                if (stored)
                    siTran.commit();
                else
                    siTran.rollback();
            } catch (RuntimeException e)
            {
                // FFDC
                FFDCFilter.processException(
                                            e,
                                            "com.ibm.ws.sib.processor.impl.PubSubInputHandler.localPut",
                                            "1:1397:1.329.1.1",
                                            this);

                SIMPErrorException ee = new SIMPErrorException(e);

                ee.setExceptionReason(SIRCConstants.SIRC0901_INTERNAL_MESSAGING_ERROR);
                ee.setExceptionInserts(new String[] { "com.ibm.ws.sib.processor.impl.ProducerSessionImpl.handleMessage",
                                                     "1:1404:1.329.1.1",
                                                     SIMPUtils.getStackTrace(e) });
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                {
                    SibTr.exception(tc, ee);
                    SibTr.exit(tc, "localPut", ee);
                }

                throw ee;

            } catch (SIRollbackException e)
            {
                // No FFDC code needed
                handleRollback(siTran);

                SIMPRollbackException ee = new SIMPRollbackException(e.getMessage());
                ee.setStackTrace(e.getStackTrace());
                ee.setExceptionReason(SIRCConstants.SIRC0901_INTERNAL_MESSAGING_ERROR);
                ee.setExceptionInserts(new String[] { "com.ibm.ws.sib.processor.impl.ProducerSessionImpl.handleMessage",
                                                     "1:1424:1.329.1.1",
                                                     SIMPUtils.getStackTrace(e) });

                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "localPut", ee);

                throw ee;
            } catch (SIConnectionLostException e)
            {
                // No FFDC code needed
                handleRollback(siTran);

                SIMPConnectionLostException ee = new SIMPConnectionLostException(e.getMessage());
                ee.setStackTrace(e.getStackTrace());
                ee.setExceptionReason(SIRCConstants.SIRC0901_INTERNAL_MESSAGING_ERROR);
                ee.setExceptionInserts(new String[] { "com.ibm.ws.sib.processor.impl.ProducerSessionImpl.handleMessage",
                                                     "1:1441:1.329.1.1",
                                                     SIMPUtils.getStackTrace(e) });

                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "localPut", ee);

                throw ee;
            } catch (SIIncorrectCallException e)
            {
                // No FFDC code needed
                handleRollback(siTran);

                SIMPIncorrectCallException ee = new SIMPIncorrectCallException(e.getMessage());
                ee.setStackTrace(e.getStackTrace());
                ee.setExceptionReason(SIRCConstants.SIRC0901_INTERNAL_MESSAGING_ERROR);
                ee.setExceptionInserts(new String[] { "com.ibm.ws.sib.processor.impl.ProducerSessionImpl.handleMessage",
                                                     "1:1458:1.329.1.1",
                                                     SIMPUtils.getStackTrace(e) });
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "localPut", ee);
                throw ee;
            } catch (SIResourceException e)
            {
                // No FFDC code needed
                handleRollback(siTran);

                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "localPut", e);

                SIMPResourceException ee = new SIMPResourceException(e);
                ee.setExceptionReason(SIRCConstants.SIRC0901_INTERNAL_MESSAGING_ERROR);
                ee.setExceptionInserts(new String[] { "com.ibm.ws.sib.processor.impl.ProducerSessionImpl.handleMessage",
                                                     "1:1475:1.329.1.1",
                                                     SIMPUtils.getStackTrace(e) });
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "localPut", ee);
                throw ee;
            }

            // Release the JsMessage from the parent MessageItem (Any MessageItemReferences will
            // have their own references to the JsMessage (unless they've released their's too)
            msg.releaseJsMessage();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "localPut");
    }
89886
public void setAuditRepositoryTransport(String transport) throws IllegalArgumentException
    {
    	if (!transport.equalsIgnoreCase("SYSLOG") && !transport.equalsIgnoreCase("UDP") && !transport.equalsIgnoreCase("TLS") && !transport.equalsIgnoreCase("BSD"))
    		throw new IllegalArgumentException("Audit Repository transport must be set to one of: SYSLOG, UDP, TLS, or BSD.  Received: " + transport);
    	setOption(AUDITOR_AUDIT_REPOSITORY_TRANSPORT_KEY, transport.toUpperCase());
    }
608265
private void writeMessageEmbeddedWebServerIpPort(Socket s) throws Exception {
    writeType(s, TYPE_EMBEDDED_WEB_SERVER_IP_PORT);
    writeString(s, _embeddedWebServerIp);
    writeInt(s, _embeddedWebServerPort);
  }
1345869
@Override
    public void send(PayloadData payloadData) throws Exception {
        if (logger.isDebugEnabled()) {
            logger.debug(String.format("Tx : Ass=%s %s", this.getName(), payloadData));
        }

        NettySctpChannelInboundHandlerAdapter handler = checkSocketIsOpen();

        final ByteBuf byteBuf = payloadData.getByteBuf();
        if (this.ipChannelType == IpChannelType.SCTP) {
            SctpMessage sctpMessage = new SctpMessage(payloadData.getPayloadProtocolId(), payloadData.getStreamNumber(),
                    payloadData.isUnordered(), byteBuf);
            handler.writeAndFlush(sctpMessage);
        } else {
            handler.writeAndFlush(byteBuf);
        }
    }