首页 > 其他 > 详细

posix quic write read

时间:2021-04-13 23:36:48      阅读:20      评论:0      收藏:0      [点我收藏+]

 

QuicWrite

 

 

(gdb) bt
#0  posix_quic::QuicStreamEntry::Writev (this=this@entry=0x84cee0, iov=iov@entry=0xffffffff8fe8, iov_count=iov_count@entry=1, fin=fin@entry=false) at /root/posix_quic/src/stream_entry.cpp:19
#1  0x0000000000412bf4 in posix_quic::QuicWritev (stream=stream@entry=2, iov=0xffffffff8fe8, iov@entry=0xffffffff8ff8, iov_count=iov_count@entry=1, fin=fin@entry=false) at /root/posix_quic/src/quic_socket.cpp:236
#2  0x0000000000412f58 in posix_quic::QuicWrite (stream=stream@entry=2, data=data@entry=0xffff00000001, length=length@entry=11, fin=fin@entry=false) at /root/posix_quic/src/quic_socket.cpp:246
#3  0x0000000000402124 in doLoop (ep=3355185, ep@entry=3) at /root/posix_quic/test/client/src/client.cpp:65
#4  0x00000000004009cc in main () at /root/posix_quic/test/client/src/client.cpp:149
(gdb) 

 

ssize_t QuicStreamEntry::Writev(const struct iovec* iov, size_t iov_count, bool fin)
{
    if (Error()) {
        DebugPrint(dbg_write, "stream = %d, Has error = %d", Fd(), Error());
        errno = Error();
        return -1;
    }

    auto stream = GetQuartcStream();
    if (!stream) {
        DebugPrint(dbg_write, "stream = %d, GetQuartcStream returns nullptr", Fd());
        errno = EBADF;
        return -1;
    }

    QuicConsumedData resData = stream->WritevData(iov, iov_count, fin);
    if (resData.bytes_consumed == 0) {
        errno = EAGAIN;
        return -1;
    }

    errno = 0;
    return resData.bytes_consumed;
}

 

posix quic write read

原文:https://www.cnblogs.com/dream397/p/14655076.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!