function send($data, $length = null) {
        if (!isset($this->pipes[0]))
            return 0;
        if (!isset($length))
            $length = strlen($data);
        return intval(fwrite($this->pipes[0], $data, $length));
    }