TCP TCP::accept_client (void) { TCP ret; socklen_t len = sizeof (struct sockaddr_in); ret.close(); ret._socket_id = accept (this->_socket_id, (struct sockaddr*) &ret._address, &len); ret._opened = true; ret._binded = true; return ret; }
TCP TCP::accept_client(void) { TCP ret; socklen_t len = sizeof(struct sockaddr_in); ret.close(); #ifdef WINDOWS ret._socket_id = accept(this->_socket_id, (struct sockaddr*)&ret._address, (int*)&len); #else ret._socket_id = accept(this->_socket_id, (struct sockaddr*)&ret._address, (socklen_t*)&len); #endif ret._opened = true; ret._binded = true; return ret; }