original_string: private function handleSend()
      {
          $flow = null;
          if ($this->writtenFlow !== null) {
              $flow = $this->writtenFlow;
              $this->writtenFlow = null;
          }
  
          if (count($this->sendingFlows) > 0) {
              $this->writtenFlow = array_shift($this->sendingFlows);
              $this->stream->write($this->writtenFlow->getPacket());
          }
  
          if ($flow !== null) {
              if ($flow->isFinished()) {
                  $this->loop->nextTick(function () use ($flow) {
                      $this->finishFlow($flow);
                  });
              } else {
                  $this->receivingFlows[] = $flow;
              }
          }
      }
code: private function handleSend()
      {
          $flow = null;
          if ($this->writtenFlow !== null) {
              $flow = $this->writtenFlow;
              $this->writtenFlow = null;
          }
  
          if (count($this->sendingFlows) > 0) {
              $this->writtenFlow = array_shift($this->sendingFlows);
              $this->stream->write($this->writtenFlow->getPacket());
          }
  
          if ($flow !== null) {
              if ($flow->isFinished()) {
                  $this->loop->nextTick(function () use ($flow) {
                      $this->finishFlow($flow);
                  });
              } else {
                  $this->receivingFlows[] = $flow;
              }
          }
      }
code_tokens: private function handleSend ( ) { $ flow = null ; if ( $ this -> writtenFlow !== null ) { $ flow = $ this -> writtenFlow ; $ this -> writtenFlow = null ; } if ( count ( $ this -> sendingFlows ) > 0 ) { $ this -> writtenFlow = array_shift ( $ this -> sendingFlows ) ; $ this -> stream -> write ( $ this -> writtenFlow -> getPacket ( ) ) ; } if ( $ flow !== null ) { if ( $ flow -> isFinished ( ) ) { $ this -> loop -> nextTick ( function ( ) use ( $ flow ) { $ this -> finishFlow ( $ flow ) ; } ) ; } else { $ this -> receivingFlows [ ] = $ flow ; } } }
docstring: Handles outgoing packets.
docstring_tokens: Handles outgoing packets .