Overview
Features
Download
Documentation
Community
Add-Ons & Services

new a ftpclientsession with wrong host will blocked?

Please post support and help requests here.

new a ftpclientsession with wrong host will blocked?

Postby zebiak » 24 Dec 2013, 12:35

I create a new FTPClientSession with a wrong host IP in linux and solaris,the process blocked,but in windows it can handled by exceptions.
why?
Code: Select all
#include "Poco/net/FTPClientSession.h"
#include "Poco/Net/NetException.h"

using Poco::Net::FTPException;
using Poco::Net::FTPClientSession;
#include <sstream>
#include <map>
int main(int argc, char* argv[])
{
   try
   {
      FTPClientSession session("10.168.1.233");
    
      session.close();
      std::string a = "a";
      int b = 1;
      std::map<std::string, int> mapA;
      mapA.insert(std::make_pair(a, b));
      int c = mapA.find(a)->second;
      std::cout << c << std::endl;
      try{
         session.login("zebiak", "123123"); 
      }
      catch (FTPException&) 
      { 
         return 1;
      }
   }
   catch (Poco::Net::FTPException &e)
   {

      return 1;
   }
   catch (Poco::Net::FTPClientSession &e1)
   {
      return 1;
   }
   catch (Poco::Exception &e1)
   {
      return 1;
   }
   catch (Poco::Net::NetException &e)
   {

      return 1;
   }
   while(1);
   return 0;
}
zebiak
 
Posts: 1
Joined: 24 Dec 2013, 12:01

Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests