title: boost::asio async_send error
body: <p>The following code using boost::asio will not compile:    </p>
  
  <pre><code>#pragma once
  #include &lt;ctime&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;stdint.h&gt;
  #include &lt;boost/bind.hpp&gt;
  #include &lt;boost/shared_ptr.hpp&gt;
  #include &lt;boost/enable_shared_from_this.hpp&gt;
  #include &lt;boost/asio.hpp&gt;
  
  class Connection
  : public boost::enable_shared_from_this&lt;Connection&gt;
  {
  public:
    typedef boost::shared_ptr&lt;Connection&gt; pointer;
    static pointer create(boost::asio::io_service&amp; io_service){return pointer(new Connection(io_service));}
    virtual ~Connection();
    boost::asio::ip::tcp::socket&amp; socket();
  
    virtual void Send(uint8_t* buffer, int length);
    void handler(const boost::system::error_code&amp; error, std::size_t bytes_transferred );
  
  private:
    explicit Connection(boost::asio::io_service&amp; io_service);
    boost::asio::ip::tcp::socket socket_;
    boost::asio::ip::tcp::endpoint remote_endpoint_;
  };
  
  
  ------------------------------------------------------------------------------------------------
  #include "Connection.h"
  
  Connection::Connection(boost::asio::io_service&amp; io_service)
      : socket_(io_service)
    {
    }
  
  Connection::~Connection()
  {
      //dtor
  }
  
  
  boost::asio::ip::tcp::socket&amp; Connection::socket(){
      return socket_;
  }
  
  void Connection::Send(uint8_t* buffer, int length){
      socket_.async_send(boost::asio::buffer(buffer, length), 0, handler);
  
  }
                   // Result of operation.               // Number of bytes sent.
  void Connection::handler(const boost::system::error_code&amp; error, std::size_t bytes_transferred ){
    }
  </code></pre>
  
  <p>These are the errors this code produces in Visual C++:</p>
  
  <pre><code>Error   1   error C3867: 'Connection::handler': function call missing argument list; use '&amp;Connection::handler' to create a pointer to member   d:\c++\ugs\accountserver\connection.cpp 19
  Error   2   error C2780: 'void boost::asio::basic_stream_socket&lt;Protocol&gt;::async_send(const ConstBufferSequence &amp;,WriteHandler)' : expects 2 arguments - 3 provided d:\c++\ugs\accountserver\connection.cpp 19
  </code></pre>
  
  <p>Why are these errors occurring, and what can I do to fix them?</p>