Skip to content

Commit

Permalink
Initialize revents by 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ShotaTanemura committed Jan 29, 2024
1 parent 498e954 commit be964b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/sockets/ClientSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ClientSocket::ClientSocket() {}

ClientSocket::ClientSocket(int const fd) : _fd(fd), _phase(ClientSocket::RECV), _lastSendTimestamp(std::time(NULL)) {}
ClientSocket::ClientSocket(int const fd) : _fd(fd), _revents(0), _phase(ClientSocket::RECV), _lastSendTimestamp(std::time(NULL)) {}

int ClientSocket::getFd() const {
return this->_fd;
Expand Down
4 changes: 2 additions & 2 deletions src/sockets/ServerSocket.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "ServerSocket.hpp"

ServerSocket::ServerSocket() {}
ServerSocket::ServerSocket(std::string ipaddress, std::string port) : _ipaddress(ipaddress), _port(port) {}
ServerSocket::ServerSocket(std::string ipaddress, std::string port) : _ipaddress(ipaddress), _port(port), _revents(0) {}

static u_int32_t convertIpStrToUint(std::string const &ipaddr) {
u_int32_t s_addr(0);
Expand Down Expand Up @@ -85,4 +85,4 @@ int ServerSocket::getFd() const {
// int main() {
// ServerSocket ss("8.8.8.8", "8080");
// ss.init();
// }
// }

0 comments on commit be964b0

Please sign in to comment.