Skip to content

Conversation

@myutman
Copy link

@myutman myutman commented Feb 19, 2019

No description provided.

@myutman myutman changed the title Yutman: Lab1 client Yutman: Lab1 client (for Bartosh server) Feb 19, 2019
rw_t buf[4];
bzero(buf, sizeof(rw_t) * 4);
int flags = fcntl(sockfd, F_GETFL, 0);
fcntl(sockfd, F_SETFL, flags | O_NONBLOCK);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Флаг устанавливается для сокета, т.е. в другой потоке сокет тоже становится неблокирующим. Вместо этого лучше указать флаг для recv.

ssize_t n;
for (int i = 0; i < nums.size();) {
int j = 0;
for (; j < 255 && i + j < nums.size(); j++) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants