TransportModelT - creating websocket transport in transport_factory
This commit is contained in:
Родитель
68475cb441
Коммит
efd80006c2
|
@ -30,7 +30,7 @@ namespace signalr
|
|||
web::uri m_base_uri;
|
||||
utility::string_t m_querystring;
|
||||
|
||||
// the order is important since we the factories are used to create and initialize the connection_impl instance
|
||||
// the order is important since the factories are used to create and initialize the connection_impl instance
|
||||
web_request_factory m_web_request_factory;
|
||||
transport_factory m_transport_factory;
|
||||
|
||||
|
|
|
@ -12,10 +12,7 @@ namespace signalr
|
|||
class transport_factory
|
||||
{
|
||||
public:
|
||||
std::unique_ptr<transport> virtual create_transport(transport_type /*transport_type*/)
|
||||
{
|
||||
throw std::exception("not implemented");
|
||||
}
|
||||
std::unique_ptr<transport> virtual create_transport(transport_type transport_type);
|
||||
|
||||
virtual ~transport_factory() {};
|
||||
};
|
||||
|
|
|
@ -116,6 +116,7 @@
|
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\transport_factory.cpp" />
|
||||
<ClCompile Include="..\..\url_builder.cpp" />
|
||||
<ClCompile Include="..\..\web_request.cpp" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -95,6 +95,9 @@
|
|||
<ClCompile Include="..\..\connection.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\transport_factory.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "signalrclient\transport_factory.h"
|
||||
#include "websocket_transport.h"
|
||||
|
||||
namespace signalr
|
||||
{
|
||||
std::unique_ptr<transport> transport_factory::create_transport(transport_type transport_type)
|
||||
{
|
||||
if (transport_type == transport_type::websockets)
|
||||
{
|
||||
return std::make_unique<websocket_transport<>>();
|
||||
}
|
||||
|
||||
throw std::exception("not implemented");
|
||||
}
|
||||
|
||||
}
|
|
@ -22,7 +22,7 @@ namespace signalr
|
|||
: m_websocket_client(std::move(websocket_client))
|
||||
{ }
|
||||
|
||||
websocket_transport(T websocket_client)
|
||||
websocket_transport(const T &websocket_client)
|
||||
: m_websocket_client(websocket_client)
|
||||
{ }
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче