🔨」 fix: fixed invalid read and accept issue

This commit is contained in:
2025-04-23 16:23:20 +02:00
parent 5a2285e3d0
commit 84407173e0
2 changed files with 9 additions and 9 deletions

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/04/17 11:58:42 by adjoly #+# #+# */
/* Updated: 2025/04/23 15:33:00 by adjoly ### ########.fr */
/* Updated: 2025/04/23 16:00:14 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
@ -47,11 +47,6 @@ int Server::_createSocket(std::string host, int port) {
return -1;
}
if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) {
close(fd);
throw std::runtime_error("fcntl failed");
}
int opt = 1;
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) < 0) {
close(fd);