Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
I am using poco libraries to access ftp server, on yocto linux (hw is a microcontroller).
If I specify a valid address (ftp host) all works properly, if I use a non-existing ftp address , the "open" method hangs for 129 seconds! Afterward it throws the following Poco::Exception..
displayText->"N4Poco9ExceptionE"
what->"Exception"
message->""
name->"Exception"
code->"110"
here the code..
Poco::Net::FTPClientSession ftp;
ftp.open(host,port); <<<<<<<<< hangs here
ftp.login(userName,password);
ftp.logout();
ftp.close();
catch(Poco::Exception exc)
The setTimeout() methods works only after calling the open() method (otherwise it throws an exception). However ,if I set the internal _timeout variable with a c++ pointer hack, no luck..seems not related to ftp timeout.
If I break the debugger this is the stack..
1 __libc_connect connect.c 26 0xffffbe68bb8c
2 ?? 0xffffbf1b1ab0
(connect.c)
#include <sys/socket.h>
#include <sysdep-cancel.h>
#include <socketcall.h>
int __libc_connect (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len)
#ifdef __ASSUME_CONNECT_SYSCALL
return SYSCALL_CANCEL (connect, fd, addr.__sockaddr__, len); <<< THE DEBUGGER BREAKS HERE
#else
return SOCKETCALL_CANCEL (connect, fd, addr.__sockaddr__, len);
#endif
Thanks in advance for your help.
Best regards,
–
–
–
–
If nobody know how to solve using poco FTPClientSession object, I can try to precede the FTPClientSession::open() by this call (QT lib)..
QTcpSocket socket;
socket.connectToHost("xxx.xxx.xxx.198",21);
bool bConnected = socket.waitForConnected(10*1000); //ms
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.