Helper method to check if the given byte buffer is a data message.

@param msg the message to check.
@return true if it is, false otherwise.
554359
private static boolean isDataMessage(final ByteBuf msg) {
    return DcpMutationMessage.is(msg) || DcpDeletionMessage.is(msg) || DcpExpirationMessage.is(msg);
  }
760303
public boolean isSendRemoteMessage(BaseMessage message)
    {
        if (message instanceof RecordMessage)   // Always
        {
            RecordMessageHeader recMessageHeader = (RecordMessageHeader)message.getMessageHeader();
            int iChangeType = recMessageHeader.getRecordMessageType();
            if (m_iDatabaseType == recMessageHeader.getDatabaseType())
                if (DBParams.CLIENT.equals(recMessageHeader.getSourceType()))   // Don't send only if Client DB is handling these messages.
            {
                if (!(this instanceof GridRecordMessageFilter))
                    if ((iChangeType == DBConstants.AFTER_UPDATE_TYPE)
                        || (iChangeType == DBConstants.AFTER_ADD_TYPE)
                        || (iChangeType == DBConstants.AFTER_DELETE_TYPE))
                            return false;    // The remote version of me handles this message remotely.
                if (this instanceof GridRecordMessageFilter)
                    if (iChangeType == DBConstants.AFTER_REQUERY_TYPE)
                        return false;    // The remote version of me handles this message remotely.
            }
        }
        return super.isSendRemoteMessage(message);
    }
1367822
public boolean log(WsByteBuffer data) {
        if (null == data) {
            // return failure
            return false;
        }
        // if we've stopped then there is no worker to hand this to; however, the
        // caller does not expect to have to release buffers handed to the
        // logger so do that here first
        if (State.RUNNING != this.state) {
            data.release();
            return false;
        }
        return this.myWorker.enqueue(data);
    }
363386
def _has_message(self):
        
        sep = protocol.MINIMAL_LINE_SEPARATOR.encode(self.encoding)
        return sep in self._receive_buffer
124587
function (msg) {
		var i = this.msgs.length;

		this.msgs.push('ERROR: ' + msg);
		if ((i + 1) !== this.msgs.length) {
			return false;
		}
		return true;
	}
1042363
private boolean isClientBufferFull(final long now) {
        // check client buffer length when we've already sent some messages
        if (lastMessageTs > 0) {
            // duration the stream is playing / playback duration
            final long delta = now - playbackStart;
            // buffer size as requested by the client
            final long buffer = subscriberStream.getClientBufferDuration();
            // expected amount of data present in client buffer
            final long buffered = lastMessageTs - delta;
            log.trace("isClientBufferFull: timestamp {} delta {} buffered {} buffer duration {}", new Object[] { lastMessageTs, delta, buffered, buffer });
            // fix for SN-122, this sends double the size of the client buffer
            if (buffer > 0 && buffered > (buffer * 2)) {
                // client is likely to have enough data in the buffer
                return true;
            }
        }
        return false;
    }
49273
public boolean sendToMatching(Msg msg)
    {
        //  Is this end of a multipart message?
        boolean msgMore = msg.hasMore();

        //  Push the message to matching pipes.
        distribute(msg);

        //  If mutlipart message is fully sent, activate all the eligible pipes.
        if (!msgMore) {
            active = eligible;
        }

        more = msgMore;

        return true;
    }
656672
public static boolean isXHTMLMessage(Message message) {
        return message.getExtension(XHTMLExtension.ELEMENT, XHTMLExtension.NAMESPACE) != null;
    }
1015025
public static int extractFlagsFromType2Message(byte[] msg) {
        byte[] flagsBytes = new byte[4];

        System.arraycopy(msg, 20, flagsBytes, 0, 4);
        ByteUtilities.changeWordEndianess(flagsBytes, 0, 4);

        return ByteUtilities.makeIntFromByte4(flagsBytes);
    }
192821
def on_message(self, msg=None):
        
        if msg is None:
            try:
                msg = self.ws.recv()
            except Exception as e:
                self.subscriber.on_message_error(
                    'Error while receiving packet: %s' % str(e))
                self.disconnect()
                return False

        if not msg:
            self.subscriber.on_message_error('Empty message received')
            return False

        buf = BufferStruct(msg)
        opcode = buf.pop_uint8()
        try:
            packet_name = packet_s2c[opcode]
        except KeyError:
            self.subscriber.on_message_error('Unknown packet %s' % opcode)
            return False

        if not self.ingame and packet_name in ingame_packets:
            self.subscriber.on_ingame()
            self.ingame = True

        parser = getattr(self, 'parse_%s' % packet_name)
        try:
            parser(buf)
        except BufferUnderflowError as e:
            msg = 'Parsing %s packet failed: %s' % (packet_name, e.args[0])
            self.subscriber.on_message_error(msg)

        if len(buf.buffer) != 0:
            msg = 'Buffer not empty after parsing "%s" packet' % packet_name
            self.subscriber.on_message_error(msg)

        return packet_name
961733
public void sendMessage(String message){

		byte[] datagramData = message.getBytes();
		datagramPacket.setData(datagramData);

		try {
			datagramSocket.send(datagramPacket);
		} catch (IOException e) {
			Log.e(TAG, "Failed to send datagram log " + e);
		}
	}
238643
public static <T> Result<T> successfulWithoutData(String msg) {
        return Result.<T>builder().success(true).msg(msg).build();
    }
1083704
public boolean readMessage(InputStream is, OutboxAmp outbox)
    throws IOException
  {    
    InH3 hIn = _hIn;
    
    if (is.available() < 0) {
      return false;
    }

    //hIn.initPacket(is);
    
    try {
      return readMessage(hIn, outbox);
    } finally {
      //outbox.setInbox(null);
    }
  }
263559
public boolean isSendRemoteMessage(BaseMessage message)
    {
        Iterator<BaseMessageFilter> iterator = this.getMessageFilterList().getFilterList(null);    // ALL The filters (not just matches).
        while (iterator.hasNext())
        {
            BaseMessageFilter filter = iterator.next();
            if (!filter.isRemoteFilter())   // Always send down when filter is a remote copy
                if (filter.isSendRemoteMessage(message) == false)
                    return false;      // Don't send this message down
        }
        return true;
    }
1024869
def _is_msg(self, msg):
        
        if not msg or len(msg) < self.prefix_len:
            return False
        length = self._extract_len(msg[:self.prefix_len])
        msg_type = msg[self.prefix_len:].split(' ', 1)[0]
        if length == len(msg[self.prefix_len:]) and msg_type in self.msg_types:
            return True
        return False
1024275
public void w(final String msg) {
        logMgr.log(tag, LogLevelConst.WARNING, msg, null);
    }
812980
protected boolean checkSupportedMessageTypes(Message msg) {
        if (msg instanceof TextMessage) {
            return true;
        } else {
            try {
                log.error("Unsupported message type: " + msg.getJMSType());
            } catch (JMSException ignore) {
            }
            sendToInvalidMessageQueue(msg);
            return false;
        }
    }