flush method

void flush()

Flush write buffers.

@api private

Implementation

void flush() {
  if ('closed' != readyState &&
      transport!.writable == true &&
      upgrading != true &&
      writeBuffer.isNotEmpty) {
    _logger.fine('flushing ${writeBuffer.length} packets in socket');
    transport!.send(writeBuffer);
    // keep track of current length of writeBuffer
    // splice writeBuffer and callbackBuffer on `drain`
    prevBufferLen = writeBuffer.length;
    emit('flush');
  }
}