Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Release/include/cpprest/details/basic_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ typedef uint32_t HRESULT; // Needed for PPLX
typedef wchar_t char_t ;
typedef std::wstring string_t;
#define _XPLATSTR(x) L ## x
#define _XPLATTOSTR(x) std::to_wstring(x)
typedef std::wostringstream ostringstream_t;
typedef std::wofstream ofstream_t;
typedef std::wostream ostream_t;
Expand All @@ -67,6 +68,7 @@ typedef std::wstringstream stringstream_t;
typedef char char_t;
typedef std::string string_t;
#define _XPLATSTR(x) x
#define _XPLATTOSTR(x) std::to_string(x)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it makes more sense to define a template<class T> string_t to_string_t(T&&)?

typedef std::ostringstream ostringstream_t;
typedef std::ofstream ofstream_t;
typedef std::ostream ostream_t;
Expand Down
11 changes: 0 additions & 11 deletions Release/include/cpprest/details/web_utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,6 @@

namespace web
{

namespace http { namespace client { namespace details {
class winhttp_client;
class winrt_client;
class asio_context;
}}}
namespace websockets { namespace client { namespace details {
class winrt_callback_client;
class wspp_callback_client;
}}}

namespace details
{

Expand Down
2 changes: 1 addition & 1 deletion Release/include/cpprest/streams.h
Original file line number Diff line number Diff line change
Expand Up @@ -1748,7 +1748,7 @@ class type_parser<CharType, std::enable_if_t<sizeof(CharType) == 1, std::basic_s

static pplx::task<std::wstring> parse(streams::streambuf<CharType> buffer)
{
return base::_parse_input<std::basic_string<char>,std::basic_string<wchar_t>>(buffer, _accept_char, _extract_result);
return base::template _parse_input<std::basic_string<char>,std::basic_string<wchar_t>>(buffer, _accept_char, _extract_result);
}

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ using websocketpp::lib::bind;

using websocketpp::lib::thread;
using websocketpp::lib::mutex;
using websocketpp::lib::unique_lock;
using websocketpp::lib::lock_guard;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is part of the vendored copy of websocketpp, so we should avoid modifying it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I'll revert changes in this example.

using websocketpp::lib::condition_variable;

/* on_open insert connection_hdl into channel
Expand Down Expand Up @@ -71,15 +71,15 @@ class broadcast_server {
}

void on_open(connection_hdl hdl) {
unique_lock<mutex> lock(m_action_lock);
lock_guard<mutex> lock(m_action_lock);
//std::cout << "on_open" << std::endl;
m_actions.push(action(SUBSCRIBE,hdl));
lock.unlock();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm apparently this isn't built?

m_action_cond.notify_one();
}

void on_close(connection_hdl hdl) {
unique_lock<mutex> lock(m_action_lock);
lock_guard<mutex> lock(m_action_lock);
//std::cout << "on_close" << std::endl;
m_actions.push(action(UNSUBSCRIBE,hdl));
lock.unlock();
Expand All @@ -88,7 +88,7 @@ class broadcast_server {

void on_message(connection_hdl hdl, server::message_ptr msg) {
// queue message up for sending by processing thread
unique_lock<mutex> lock(m_action_lock);
lock_guard<mutex> lock(m_action_lock);
//std::cout << "on_message" << std::endl;
m_actions.push(action(MESSAGE,hdl,msg));
lock.unlock();
Expand All @@ -97,7 +97,7 @@ class broadcast_server {

void process_messages() {
while(1) {
unique_lock<mutex> lock(m_action_lock);
lock_guard<mutex> lock(m_action_lock);

while(m_actions.empty()) {
m_action_cond.wait(lock);
Expand All @@ -109,13 +109,13 @@ class broadcast_server {
lock.unlock();

if (a.type == SUBSCRIBE) {
unique_lock<mutex> con_lock(m_connection_lock);
lock_guard<mutex> con_lock(m_connection_lock);
m_connections.insert(a.hdl);
} else if (a.type == UNSUBSCRIBE) {
unique_lock<mutex> con_lock(m_connection_lock);
lock_guard<mutex> con_lock(m_connection_lock);
m_connections.erase(a.hdl);
} else if (a.type == MESSAGE) {
unique_lock<mutex> con_lock(m_connection_lock);
lock_guard<mutex> con_lock(m_connection_lock);

con_list::iterator it;
for (it = m_connections.begin(); it != m_connections.end(); ++it) {
Expand Down
Loading