-
Notifications
You must be signed in to change notification settings - Fork 26
Grigory Bartosh: 02 server #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
|
||
| ~TaskData() | ||
| { | ||
| pthread_join(*thread, NULL); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 класс начинает иметь смысл для описания задач. Т.е. по сути, два разных по своим целям класса были объединены в один.
|
Ещё стоило удалить файлы из предыдущего задания. Я долго не мог понять, где же новый код. |
|
И ещё не хватает описания протокола |
No description provided.