mirror of
https://github.com/qicosmos/rest_rpc.git
synced 2026-08-30 00:50:48 +08:00
add user data in connection.
This commit is contained in:
@@ -70,7 +70,7 @@
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<IncludePath>..\..\include;..\..\third\msgpack\include;$(IncludePath)</IncludePath>
|
||||
<IncludePath>..\..\include;..\..\thirdparty\msgpack-c\include;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<IncludePath>..\..\include;..\..\third\msgpack\include;$(IncludePath)</IncludePath>
|
||||
|
||||
@@ -76,8 +76,8 @@
|
||||
<IncludePath>..\..\include;..\..\third\msgpack\include;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<IncludePath>..\..\include;..\..\third\msgpack\include;D:\boost_1_73_0;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>D:\boost_1_73_0\lib64-msvc-14.2;$(LibraryPath)</LibraryPath>
|
||||
<IncludePath>..\..\include;..\..\thirdparty\msgpack-c\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<IncludePath>..\..\include;..\..\third\msgpack\include;$(IncludePath)</IncludePath>
|
||||
|
||||
@@ -7,6 +7,13 @@ using namespace rpc_service;
|
||||
|
||||
struct dummy{
|
||||
int add(rpc_conn conn, int a, int b) {
|
||||
auto shared_conn = conn.lock();
|
||||
if (shared_conn) {
|
||||
shared_conn->set_user_data(std::string("aa"));
|
||||
auto s = conn.lock()->get_user_data<std::string>();
|
||||
std::cout << s << '\n'; //aa
|
||||
}
|
||||
|
||||
return a + b;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user