I’ve got a problem with connecting to an FTP server.
I’m calling a function which connectes to an FTP server with the following code:
ftpCommandChannel = wip_FTPCreateOpts(host, ftpCommandEventHandler, NULL, WIP_COPT_PEER_PORT, port, WIP_COPT_USER, user, WIP_COPT_PASSWORD, pass, WIP_COPT_FINALIZER, ftpCommandFinalizer, WIP_COPT_END);
Now the problem is that when I call this function from a command handler (adl_atCmdHandler_t) which I’m using for tests, everything is working fine. When I call the function from a message handler (adl_msgHandler_f), wip_FTPCreateOpts return a NULL pointer and prints the following error trace:
ERRLOG …/src/ftp.c:135: Can’t create control socket
I can’t find anything in the documentation (what a surprise) and unfortunately also not on the forum.
Can anyone help me out?
On this point I see two work arounds (haven’t tested them yet).
- I create a seperate task for FTP communication and let it wait on an event which I can trigger from the message handler
- I start a timer for 1 second so the FTP creation will be done in a timer handler
I don’t like both and the most important thing is that I don’t understand why I get this problem.
thanks a lot