Skip to content

Conversation

@GrigoryBartosh
Copy link

No description provided.


~TaskData()
{
pthread_join(*thread, NULL);
Copy link
Owner

Choose a reason for hiding this comment

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

Выполнять потенциально длительную операцию в деструкторе - такое себе. Весьма легкий способ выстрелить себе в ногу и потом долго искать, из-за чего код внезапно так тормозит.

Server server(port);
server.run();
} catch (...) {
cout << "AAAAAAAAAAAAAAA" << endl;
Copy link
Owner

Choose a reason for hiding this comment

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

:)

pthread_mutex_destroy(mutex_is_finished);

if (!is_long_operation) {
close(sockfd);
Copy link
Owner

Choose a reason for hiding this comment

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

Мне кажется, что TaskData - не самое логичное место, чтобы управлять сокетами. По сути, сейчас TaskData с is_long_operation == false играет роль хэндла для сокета, и только в случае is_long_operation == true класс начинает иметь смысл для описания задач. Т.е. по сути, два разных по своим целям класса были объединены в один.

@h31
Copy link
Owner

h31 commented Mar 27, 2019

Ещё стоило удалить файлы из предыдущего задания. Я долго не мог понять, где же новый код.

@h31
Copy link
Owner

h31 commented Mar 27, 2019

И ещё не хватает описания протокола
@myutman
Но в целом сделано достаточно неплохо

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