Boost logo

Boost Users :

Subject: [Boost-users] FTP class
From: Christer Borgqvist (christer.borgqvist10_at_[hidden])
Date: 2012-02-04 06:10:04


Hello all,
I try again
in this thread i do like this
                            case CMD_PASV: {
                                std::string out = "227 Entering Passive Mode
(" + sip + ")\r\n";
                                m_data_con = data_connection_ptr(new
axftp::server::data_connection(port));
                                m_thread =
boost::thread(boost::bind(&axftp::server::data_connection::start,
m_data_con));
                                boost::asio::write(*_sock,
boost::asio::buffer(out, out.size()), e);
                           }
                            break;
class data_connection is like this

        data_connection::data_connection(size_t port) : _port(port)
        {
        }
        void data_connection::start() {
                boost::asio::io_service io_service;
                boost::asio::ip::tcp::endpoint
endpoint(boost::asio::ip::tcp::v4(), _port);
                boost::asio::ip::tcp::acceptor acceptor(io_service,
endpoint);
                boost::asio::ip::tcp::socket socket(io_service);

                acceptor.accept(socket); //
                std::string message("Hello from server\n");
                boost::asio::write(socket, boost::asio::buffer(message));
                socket.close(); .
    }
Never got a connection to the data_connection nothing happends in th
acceptor.accept (socket)
what do i do wrong
appreciate any help
Thanks Christer


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net