Untitled
public cpp v1 · immutablevoid c_socket::setAddress(string buffer){ struct hostent *host_ip; m_sin.sin_addr.s_addr = inet_addr( buffer.c_str() ); if( (int)m_sin.sin_addr.s_addr == -1 ) { cout<<"buffer avant gethostbyname: +"<<buffer.c_str()<<"+"<<endl; host_ip = gethostbyname( buffer.c_str() ); if (host_ip == NULL) cout <<endl<< "host_ip est null"<<endl; memcpy( (char *)&m_sin.sin_addr.s_addr, host_ip->h_addr, host_ip->h_length ); }}