private void send(Request request) { if( failure !=null ) { if( request.cb!=null ) { request.cb.onFailure(failure); } } else { // Put the request in the map before sending it over the wire. if(request.id!=0) { this.requests.put(request.id, request); } if( overflow.isEmpty() && transport!=null && transport.offer(request.frame) ) { mqtt.tracer.onSend(request.frame); if(request.id==0) { if( request.cb!=null ) { ((Callback<Void>)request.cb).onSuccess(null); } } } else { // Remove it from the request. this.requests.remove(request.id); overflow.addLast(request); } } }
while((request=overflow.peek())!=null) { if( this.transport.offer(request.frame) ) { mqtt.tracer.onSend(request.frame); overflow.removeFirst(); if(request.id==0) {
MQTTFrame encoded = new PINGREQ().encode(); if(CallbackConnection.this.transport.offer(encoded)) { mqtt.tracer.onSend(encoded); final long now = System.currentTimeMillis(); final long suspends = suspendChanges.get();
mqtt.tracer.onSend(encoded); mqtt.tracer.debug("Logging in"); assert accepted: "First frame should always be accepted by the transport";
private void send(Request request) { if( failure !=null ) { if( request.cb!=null ) { request.cb.onFailure(failure); } } else { // Put the request in the map before sending it over the wire. if(request.id!=0) { this.requests.put(request.id, request); } if( overflow.isEmpty() && transport!=null && transport.offer(request.frame) ) { mqtt.tracer.onSend(request.frame); if(request.id==0) { if( request.cb!=null ) { ((Callback<Void>)request.cb).onSuccess(null); } } } else { // Remove it from the request. this.requests.remove(request.id); overflow.addLast(request); } } }
while((request=overflow.peek())!=null) { if( this.transport.offer(request.frame) ) { mqtt.tracer.onSend(request.frame); overflow.removeFirst(); if(request.id==0) {
MQTTFrame encoded = new PINGREQ().encode(); if(CallbackConnection.this.transport.offer(encoded)) { mqtt.tracer.onSend(encoded); final long now = System.currentTimeMillis(); final long suspends = suspendChanges.get();
mqtt.tracer.onSend(encoded); mqtt.tracer.debug("Logging in"); assert accepted: "First frame should always be accepted by the transport";