52 Star 241 Fork 97

OpenHarmony / communication_services_softbus_lite

讨论:tcp_socket.c 里TcpSendData和TcpRecvData传了timeout参数,但是没有实现timeout机制

Task
Backlog
yalinjiang  Opened this issue

该问题是怎么引起的?

tcp_socket.c 里TcpSendData和TcpRecvData传了timeout参数,但是没有实现timeout机制

重现步骤

static int32_t TcpRecvMessages(int fd, char *buf, uint32_t len, int timeout, int flags)
{
if (fd < 0 || buf == NULL || len == 0 || timeout < 0) {
return -1;
}

errno = 0;
int32_t rc = recv(fd, buf, len, flags);
if ((rc == -1) && (errno == EAGAIN)) {
    SOFTBUS_PRINT("[TRANS] TcpRecvMessages recv fail, errno is eagain\n");
    rc = 0;
} else if (rc <= 0) {
    rc = -1;
    SOFTBUS_PRINT("[TRANS] TcpRecvMessage recv fail, errno is %s\n", strerror(errno));
}
return rc;

}

报错信息

Attachments
total 2 participants

Comments (1)

robinyin 2020-09-14 10:05 member

看了一下,这个接口属于内部接口,这个参数是预留的。原计划打算提供一个通信超时机制
如果您有兴趣,强烈的、热烈的欢迎您参与开发,在鸿蒙OS的上留下您的贡献

Sign in to comment

Assignees
Labels
Not set
Projects
Milestones
Branches
Planed to start
Not set
Planed to end
Not set
Top level
Priority
1
https://git.oschina.net/openharmony/communication_services_softbus_lite.git
git@git.oschina.net:openharmony/communication_services_softbus_lite.git
openharmony
communication_services_softbus_lite
communication_services_softbus_lite

Search

153430 a91d09cc 1899542 180418 42a90fc8 1899542