Beispiel #1
0
 /**
  * Called by the transport after a new connection is created to initialize
  * the socket component of the connection. This method is not allowed to 
  * write any bytes to the wire. This initialization happens before any 
  * proxies or other intermediate wrappers are negotiated.
  * 
  * @param callback Handler to call back with completion information
  */
 void pre_init(init_handler callback) {
     if (m_socket_init_handler) {
         m_socket_init_handler(m_hdl,get_socket());
     }
     
     callback(lib::error_code());
 }
Beispiel #2
0
    /**
     * Called by the transport after a new connection is created to initialize
     * the socket component of the connection. This method is not allowed to
     * write any bytes to the wire. This initialization happens before any
     * proxies or other intermediate wrappers are negotiated.
     *
     * @param callback Handler to call back with completion information
     */
    void pre_init(init_handler callback) {
        if (m_state != READY) {
            callback(socket::make_error_code(socket::error::invalid_state));
            return;
        }

        if (m_socket_init_handler) {
            m_socket_init_handler(m_hdl,*m_socket);
        }

        m_state = READING;

        callback(lib::error_code());
    }