134
134
Critical<AsioProtonet> crit(net_);
136
log_debug << "connect handler " << id() << " " << ec;
146
assign_remote_addr();
146
assign_remote_addr();
147
147
#ifdef HAVE_ASIO_SSL_HPP
148
if (ssl_socket_ != 0)
150
ssl_socket_->lowest_layer().set_option(
151
asio::ip::tcp::no_delay(true));
152
set_fd_options(ssl_socket_->lowest_layer());
153
log_debug << "socket " << id() << " connected, remote endpoint "
154
<< remote_addr() << " local endpoint "
148
if (ssl_socket_ != 0)
150
ssl_socket_->lowest_layer().set_option(
151
asio::ip::tcp::no_delay(true));
152
set_fd_options(ssl_socket_->lowest_layer());
153
log_debug << "socket " << id() << " connected, remote endpoint "
154
<< remote_addr() << " local endpoint "
158
156
ssl_socket_->async_handshake(
159
157
asio::ssl::stream<asio::ip::tcp::socket>::client,
160
158
boost::bind(&AsioTcpSocket::handshake_handler,
161
159
shared_from_this(),
162
160
asio::placeholders::error)
165
catch (asio::system_error& e)
167
FAILED_HANDLER(e.code());
173
165
#endif /* HAVE_ASIO_SSL_HPP */
174
socket_.set_option(asio::ip::tcp::no_delay(true));
175
set_fd_options(socket_);
176
log_debug << "socket " << id() << " connected, remote endpoint "
177
<< remote_addr() << " local endpoint "
179
state_ = S_CONNECTED;
180
net_.dispatch(id(), Datagram(), ProtoUpMeta(ec.value()));
166
socket_.set_option(asio::ip::tcp::no_delay(true));
167
set_fd_options(socket_);
168
log_debug << "socket " << id() << " connected, remote endpoint "
169
<< remote_addr() << " local endpoint "
171
state_ = S_CONNECTED;
172
net_.dispatch(id(), Datagram(), ProtoUpMeta(ec.value()));
183
175
#ifdef HAVE_ASIO_SSL_HPP
177
#endif /* HAVE_ASIO_SSL_HPP */
185
#endif /* HAVE_ASIO_SSL_HPP */
180
catch (asio::system_error& e)
182
FAILED_HANDLER(e.code());