Ignore:
Timestamp:
08/22/11 21:43:56 (22 months ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2
Children:
0b8df3e
Parents:
bd18eb2
Message:
  • Fixed so it works on linux (fixed issues with timeout)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/NSCPClient/NSCPClient.cpp

    r438998b r4632ff7  
    250250      return nscp_result_data(NSCAPI::returnUNKNOWN, _T("SSL support not available (compiled without USE_SSL)!")); 
    251251#endif 
    252     } else 
     252    } else { 
    253253      chunks = send_nossl(con.host, con.port, con.timeout, chunks); 
     254    } 
    254255    BOOST_FOREACH(nscp::packet::nscp_chunk &chunk, chunks) { 
    255       std::cout << "Found chunk: " << strEx::format_buffer(chunk.payload.c_str(), chunk.payload.size()) << std::endl; 
    256  
     256      NSC_DEBUG_MSG_STD(_T("Found chunk: ") + utf8::cvt<std::wstring>(strEx::format_buffer(chunk.payload.c_str(), chunk.payload.size()))); 
    257257    } 
    258258    return nscp_result_data(NSCAPI::returnUNKNOWN, _T("Hello")); 
    259259  } catch (nscp::nscp_exception &e) { 
     260    NSC_LOG_ERROR_STD(_T("Socket error: ") + e.getMessage()); 
    260261    return nscp_result_data(NSCAPI::returnUNKNOWN, _T("NSCP Packet error: ") + e.getMessage()); 
    261262  } catch (std::runtime_error &e) { 
    262263    NSC_LOG_ERROR_STD(_T("Socket error: ") + utf8::cvt<std::wstring>(e.what())); 
    263264    return nscp_result_data(NSCAPI::returnUNKNOWN, _T("Socket error: ") + utf8::cvt<std::wstring>(e.what())); 
    264   } catch (...) { 
     265  } catch (std::exception &e) { 
     266    NSC_LOG_ERROR_STD(_T("Exception: ") + utf8::cvt<std::wstring>(e.what())); 
     267    return nscp_result_data(NSCAPI::returnUNKNOWN, _T("Socket error: ") + utf8::cvt<std::wstring>(e.what())); 
     268  } catch (...) { 
     269    NSC_LOG_ERROR_STD(_T("Unknown exception...")); 
    265270    return nscp_result_data(NSCAPI::returnUNKNOWN, _T("Unknown error -- REPORT THIS!")); 
    266271  } 
Note: See TracChangeset for help on using the changeset viewer.