예제 #1
0
 function longlongWriteAndRead($v)
 {
     $w = new AMQPWriter();
     $w->write_longlong($v);
     $r = new AMQPReader($w->getvalue());
     $this->assertEqual($r->read_longlong(), $v);
 }
예제 #2
0
 public function send_content($channel, $class_id, $weight, $body_size, $packed_properties, $body)
 {
     $pkt = new AMQPWriter();
     $pkt->write_octet(2);
     $pkt->write_short($channel);
     $pkt->write_long(strlen($packed_properties) + 12);
     $pkt->write_short($class_id);
     $pkt->write_short($weight);
     $pkt->write_longlong($body_size);
     $pkt->write($packed_properties);
     $pkt->write_octet(0xce);
     $pkt = $pkt->getvalue();
     $this->write($pkt);
     while ($body) {
         $payload = substr($body, 0, $this->frame_max - 8);
         $body = substr($body, $this->frame_max - 8);
         $pkt = new AMQPWriter();
         $pkt->write_octet(3);
         $pkt->write_short($channel);
         $pkt->write_long(strlen($payload));
         $pkt->write($payload);
         $pkt->write_octet(0xce);
         $pkt = $pkt->getvalue();
         $this->write($pkt);
     }
 }
예제 #3
0
 /**
  * reject an incoming message
  */
 public function basic_reject($delivery_tag, $requeue)
 {
     $args = new AMQPWriter();
     $args->write_longlong($delivery_tag);
     $args->write_bit($requeue);
     $this->send_method_frame(array(60, 90), $args);
 }
예제 #4
0
 public function basicReject($delivery_tag, $requeue)
 {
     $args = new AMQPWriter();
     $args->write_longlong($delivery_tag)->write_bit($requeue);
     return $args;
 }