Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
endpoint.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <iostream>
#include <sstream>
#include <websocketpp/config/asio.hpp>
#include <websocketpp/server.hpp>
Include dependency graph for endpoint.cpp:

Go to the source code of this file.

Classes

struct  endpoint_extension
 
struct  stub_config
 

Macros

#define BOOST_TEST_MODULE   endpoint
 

Functions

 BOOST_AUTO_TEST_CASE (construct_server_iostream)
 
 BOOST_AUTO_TEST_CASE (construct_server_asio_plain)
 
 BOOST_AUTO_TEST_CASE (construct_server_asio_tls)
 
 BOOST_AUTO_TEST_CASE (initialize_server_asio)
 
 BOOST_AUTO_TEST_CASE (initialize_server_asio_external)
 
 BOOST_AUTO_TEST_CASE (endpoint_extensions)
 
 BOOST_AUTO_TEST_CASE (listen_after_listen_failure)
 

Macro Definition Documentation

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   endpoint

Definition at line 28 of file endpoint.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/7]

BOOST_AUTO_TEST_CASE ( construct_server_asio_plain )

Definition at line 41 of file endpoint.cpp.

41 {
43}
Server endpoint role based on the given config.
char * s

◆ BOOST_AUTO_TEST_CASE() [2/7]

BOOST_AUTO_TEST_CASE ( construct_server_asio_tls )

Definition at line 45 of file endpoint.cpp.

◆ BOOST_AUTO_TEST_CASE() [3/7]

BOOST_AUTO_TEST_CASE ( construct_server_iostream )

Definition at line 37 of file endpoint.cpp.

◆ BOOST_AUTO_TEST_CASE() [4/7]

BOOST_AUTO_TEST_CASE ( endpoint_extensions )

Definition at line 123 of file endpoint.cpp.

123 {
125
126 BOOST_CHECK_EQUAL( s.extension_value, 5 );
127 BOOST_CHECK_EQUAL( s.extension_method(), 5 );
128
129 BOOST_CHECK( s.is_server() );
130}

◆ BOOST_AUTO_TEST_CASE() [5/7]

BOOST_AUTO_TEST_CASE ( initialize_server_asio )

Definition at line 49 of file endpoint.cpp.

49 {
51 s.init_asio();
52}

◆ BOOST_AUTO_TEST_CASE() [6/7]

BOOST_AUTO_TEST_CASE ( initialize_server_asio_external )

Definition at line 54 of file endpoint.cpp.

54 {
56 boost::asio::io_service ios;
57 s.init_asio(&ios);
58}

◆ BOOST_AUTO_TEST_CASE() [7/7]

BOOST_AUTO_TEST_CASE ( listen_after_listen_failure )

Definition at line 132 of file endpoint.cpp.

132 {
135
138
139 websocketpp::lib::error_code ec;
140
141 server1.init_asio();
142 server2.init_asio();
143
144 boost::asio::ip::tcp::endpoint ep1(boost::asio::ip::address::from_string("127.0.0.1"), 12345);
145 boost::asio::ip::tcp::endpoint ep2(boost::asio::ip::address::from_string("127.0.0.1"), 23456);
146
147 server1.listen(ep1, ec);
148 BOOST_CHECK(!ec);
149
150 server2.listen(ep1, ec);
151 BOOST_REQUIRE_EQUAL(ec, make_error_code(pass_through));
152
153 server2.listen(ep2, ec);
154 BOOST_CHECK(!ec);
155}
lib::error_code make_error_code(error::value e)
Create an error code with the given value and the asio transport category.
Definition base.hpp:217
@ pass_through
there was an error in the underlying transport library
Definition base.hpp:171
Here is the call graph for this function: