Click to See Complete Forum and Search --> : checking ftp use from C++


tecknophreak
01-31-2002, 04:44 PM
ok, i've got this ugly program that monitors the ftp port, which at the moment looks something like:

string tmp, ipAddy("192.xx.xx.xx"), est("ESTABLISHED");
system("netstat > net.dat");
bool done(false);
ifstream is("net.dat");
while (!is.eof() && !done) {
is >> tmp;
if (tmp == ipAddy) {
is >> tmp >> tmp;
if (tmp == est) {
cout << "We've got a connection!!" << endl;
done = true;
}
}
}


the problem is that netstat takes a while (around .5 sec or so). is there some sort of other prog that i could call or some sort of include that'll help me look at a particular port(ftp)?