コード例 #1
0
ファイル: MultiCastNode.java プロジェクト: innoq/bundle-bee
 /**
  * Sends a private message.
  *
  * @param message message
  * @param address address to send the message to
  * @param port port to send the message to
  * @throws IOException if sending fails
  */
 private void sendPrivateMessage(
     final MultiCastMessage message, final InetAddress address, final int port)
     throws IOException {
   privateSocket.send(toDatagramPacket(message.toString(), address, port));
   if (LOG.isDebugEnabled()) {
     LOG.debug("Sent " + message + " to " + address + ":" + port);
   }
 }
コード例 #2
0
ファイル: MultiCastNode.java プロジェクト: innoq/bundle-bee
 public void sendToGroup(final MultiCastMessage multiCastMessage) {
   if (multiCastMessage.isValid()) {
     // reset ls request count, when we send HI
     if (multiCastMessage.getType() == MultiCastMessage.Type.HI) {
       lsRequestSent = 0;
       // make sure we have a sender set
       // even if the directory does not know, who we are
       if (multiCastMessage.getValues().getProperty(MultiCastMessage.PROPERTYKEY_SENDER) == null) {
         multiCastMessage
             .getValues()
             .setProperty(MultiCastMessage.PROPERTYKEY_SENDER, getSender());
       }
     }
     sendToGroup(multiCastMessage.toString());
   } else {
     if (LOG.isDebugEnabled()) {
       LOG.debug(
           BUNDLE_MARKER, "not sending message, because it is not valid: " + multiCastMessage);
     }
   }
 }