+ int testResult;
+
+ testResult = CheckConnect();
+ if(testResult == -1)
+ testResult = CheckIfconfig();
+ if(testResult == -1)
+ testResult = CheckPing();
+ m_IsOnline = testResult;
+}
+
+int
+wxDialUpManagerImpl::CheckConnect(void)
+{
+ // second method: try to connect to a well known host:
+ // This can be used under Win 9x, too!
+ struct hostent *hp;
+ struct sockaddr_in serv_addr;
+
+ if((hp = gethostbyname(m_BeaconHost.mb_str())) == NULL)
+ return 0; // no DNS no net
+
+ serv_addr.sin_family = hp->h_addrtype;
+ memcpy(&serv_addr.sin_addr,hp->h_addr, hp->h_length);
+ serv_addr.sin_port = htons(m_BeaconPort);
+
+ int sockfd;
+ if( ( sockfd = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0)
+ {
+ return -1; // no info
+ }
+
+ if( connect(sockfd, (struct sockaddr *) &serv_addr,
+ sizeof(serv_addr)) >= 0)
+ {
+ close(sockfd);
+ return 1; // we cant connect, so we have a network!
+ }
+ //connected!
+ close(sockfd);
+ if(errno == ENETUNREACH)
+ return 0; // network is unreachable
+ // connect failed, but don't know why
+ return -1;
+}
+
+int
+wxDialUpManagerImpl::CheckIfconfig(void)
+{
+ int rc = -1;