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

36 lines
1.0 KiB
Plaintext
Raw Normal View History

2017-06-03 18:40:28 -07:00
[/
2017-07-28 19:32:33 -07:00
Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
2017-06-03 18:40:28 -07:00
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-07-28 19:32:33 -07:00
Official repository: https://github.com/boostorg/beast
2017-06-03 18:40:28 -07:00
]
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
2017-10-26 16:05:50 -07:00
Examples use synchronous interfaces for clarity of exposition;
signatures for asynchronous operations are also provided.
2017-06-03 18:40:28 -07:00
]
[endsect]