private boolean hasRoomForNewMessagePlusReplay() { Pipe<NetPayloadSchema> server = toBroker[activeConnection.requestPipeLineIdx()];
private boolean hasRoomToSocketWriteOrDropQoSZeros() { boolean hasRoom = Pipe.hasRoomForWrite(toBroker[activeConnection.requestPipeLineIdx()]); if (!hasRoom && Pipe.peekMsg(input, 0xF & MQTTClientToServerSchema.MSG_PUBLISH_3)) { //if there is no room and the next item is a QoS 0 drop it. int qos = Pipe.peekInt(input, 0xF & MQTTClientToServerSchema.MSG_PUBLISH_3_FIELD_QOS_21); if (qos==0) { if (reportDroppedMessages) { if (Long.numberOfLeadingZeros(totalDroppedMessages) != Long.numberOfLeadingZeros(++totalDroppedMessages)) { topicDropped.setLength(0); topicDropped.append("Most recently dropped topic: "); Pipe.peekUTF8(input, 0xF & MQTTClientToServerSchema.MSG_PUBLISH_3_FIELD_TOPIC_23, topicDropped); logger.info("Network is not consuming message fast enough. {} accumulative QoS 0 messages have now been dropped." + "\nYou may want to check your network or lower the rate of messages sent. \n{}" ,totalDroppedMessages, topicDropped); } } //toss this QoS 0 message the pipes are backed up. Pipe.skipNextFragment(input); } } return hasRoom; }
if (keepAliveMS>0 || quiet>quietRepublish) { Pipe<NetPayloadSchema> pipe = toBroker[activeConnection.requestPipeLineIdx()]; if (0 == Pipe.contentRemaining(pipe)) { rePublish(pipe); requestPing(now, connectionId, toBroker[activeConnection.requestPipeLineIdx()]); lastActvityTime = now;
while (!rePublish(toBroker[activeConnection.requestPipeLineIdx()])) {
do { final Pipe<NetPayloadSchema> pipe = handshakeBegin[requestPipeLineIdx()]; assert(null!=pipe);
if (activeConnection.isBusy() || !Pipe.hasRoomForWrite(output[activeConnection.requestPipeLineIdx()])) { return false;//must try again later when the server has responded.
Pipe<NetPayloadSchema> server = toBroker[activeConnection.requestPipeLineIdx()]; assert(Pipe.isForSchema(toBroker[activeConnection.requestPipeLineIdx()], NetPayloadSchema.instance)) : "found unexpected "+Pipe.schemaName(toBroker[activeConnection.requestPipeLineIdx()]);
int useUsersPipe = connection.requestPipeLineIdx(); //this lets us return to the same pipe we registered with long connectionId = connection.getId(); if (!sendSingleMessage(pipe[useUsersPipe], connectionId, testSeeds[testIdx], testSizes[testIdx])){
} else if (writeAcksToBroker(connectionId, toBroker[activeConnection.requestPipeLineIdx()], msgIdx)) { Pipe.confirmLowLevelRead(inputAck, Pipe.sizeOf(MQTTClientToServerSchemaAck.instance, msgIdx)); Pipe.releaseReadLock(inputAck);
IdGenStage.buildRange(fieldBlockId, fieldBlockId+1)); Pipe<NetPayloadSchema> server = toBroker[activeConnection.requestPipeLineIdx()]; case PersistedBlobLoadProducerSchema.MSG_ACKWRITE_11: Pipe<NetPayloadSchema> pipe = toBroker[activeConnection.requestPipeLineIdx()]; Pipe.confirmLowLevelWrite(pipe, Pipe.sizeOf(NetPayloadSchema.instance, NetPayloadSchema.MSG_PLAIN_210)); Pipe.publishWrites(pipe);