Files
boost_beast/doc/qbk/06_websocket/2_connect.qbk

33 lines
931 B
Plaintext
Raw Normal View History

2017-06-03 18:40:28 -07:00
[/
Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
]
2017-06-16 19:27:00 -07:00
[section Establishing Connections]
2017-06-03 18:40:28 -07:00
Connections are established by invoking functions directly on the next layer
object. For example, to make an outgoing connection using a standard TCP/IP
socket:
2017-06-07 16:30:49 -07:00
[ws_snippet_6]
2017-06-03 18:40:28 -07:00
Similarly, to accept an incoming connection using a standard TCP/IP
socket, pass the next layer object to the acceptor:
2017-06-07 16:30:49 -07:00
[ws_snippet_7]
2017-06-03 18:40:28 -07:00
When using SSL, which itself wraps a next layer object that is usually a
TCP/IP socket, multiple calls to retrieve the next layer may be required.
In this example, the websocket stream wraps the SSL stream which wraps
the TCP/IP socket:
2017-06-07 16:30:49 -07:00
[wss_snippet_3]
2017-06-03 18:40:28 -07:00
[note
Examples use synchronous interfaces for clarity of exposition.
]
[endsect]