diff --git a/.gitignore b/.gitignore
index 9088c8ec2..3dcd6d3d2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -250,4 +250,5 @@ paket-files/
# JetBrains Rider
.idea/
-*.sln.iml
\ No newline at end of file
+*.sln.iml
+*.project.lock.json
\ No newline at end of file
diff --git a/NuGet/WampSharp.WebSocket4Net.nuspec b/NuGet/WampSharp.WebSocket4Net.nuspec
index 251f57bc8..2239f9408 100644
--- a/NuGet/WampSharp.WebSocket4Net.nuspec
+++ b/NuGet/WampSharp.WebSocket4Net.nuspec
@@ -15,9 +15,7 @@
-
-
-
+
WampSharp.WebSocket4Net
diff --git a/NuGet/WampSharp.nuspec b/NuGet/WampSharp.nuspec
index e2fd61d3c..33f5eac0e 100644
--- a/NuGet/WampSharp.nuspec
+++ b/NuGet/WampSharp.nuspec
@@ -10,6 +10,7 @@
+
@@ -21,6 +22,7 @@
+
@@ -37,6 +39,7 @@
+
@@ -53,6 +56,7 @@
+
WampSharp
diff --git a/src/mono/Default/WampSharp.WebSocket4Net/WampSharp.WebSocket4Net.csproj b/src/mono/Default/WampSharp.WebSocket4Net/WampSharp.WebSocket4Net.csproj
index db2cebf2f..87ae0a647 100644
--- a/src/mono/Default/WampSharp.WebSocket4Net/WampSharp.WebSocket4Net.csproj
+++ b/src/mono/Default/WampSharp.WebSocket4Net/WampSharp.WebSocket4Net.csproj
@@ -46,7 +46,7 @@
- ..\..\packages\WebSocket4Net.0.15.0-beta4\lib\net45\WebSocket4Net.dll
+ ..\..\packages\WebSocket4Net.0.15.0-beta5\lib\net45\WebSocket4Net.dll
True
@@ -54,12 +54,18 @@
Properties\AssemblyInfo.cs
+
+ WAMP2\V2\Fluent\IWebSocket4NetTransportSyntax.cs
+
WAMP2\V2\Fluent\WebSocket4NetActivator.cs
WAMP2\V2\Fluent\WebSocket4NetChannelFactoryExtensions.cs
+
+ WAMP2\V2\Fluent\WebSocket4NetTransportSyntax.cs
+
WebSocket4Net\WebSocket4NetBinaryConnection.cs
diff --git a/src/mono/Default/WampSharp.WebSocket4Net/packages.config b/src/mono/Default/WampSharp.WebSocket4Net/packages.config
index 50f0d072c..230303925 100644
--- a/src/mono/Default/WampSharp.WebSocket4Net/packages.config
+++ b/src/mono/Default/WampSharp.WebSocket4Net/packages.config
@@ -1,5 +1,5 @@
-
+
diff --git a/src/mono/Samples/WAMP1/WampSharp.CraClientSample/WampSharp.CraClientSample.csproj b/src/mono/Samples/WAMP1/WampSharp.CraClientSample/WampSharp.CraClientSample.csproj
index ca39e6be9..a789153a8 100644
--- a/src/mono/Samples/WAMP1/WampSharp.CraClientSample/WampSharp.CraClientSample.csproj
+++ b/src/mono/Samples/WAMP1/WampSharp.CraClientSample/WampSharp.CraClientSample.csproj
@@ -59,7 +59,7 @@
- ..\..\..\packages\WebSocket4Net.0.15.0-beta4\lib\net45\WebSocket4Net.dll
+ ..\..\..\packages\WebSocket4Net.0.15.0-beta5\lib\net45\WebSocket4Net.dll
True
diff --git a/src/mono/Samples/WAMP1/WampSharp.CraClientSample/packages.config b/src/mono/Samples/WAMP1/WampSharp.CraClientSample/packages.config
index cd4b177ad..3ab5628f2 100644
--- a/src/mono/Samples/WAMP1/WampSharp.CraClientSample/packages.config
+++ b/src/mono/Samples/WAMP1/WampSharp.CraClientSample/packages.config
@@ -2,5 +2,5 @@
-
+
diff --git a/src/mono/Samples/WAMP1/WampSharp.RpcClientSample/WampSharp.RpcClientSample.csproj b/src/mono/Samples/WAMP1/WampSharp.RpcClientSample/WampSharp.RpcClientSample.csproj
index 203ea4af7..5f7fa5588 100644
--- a/src/mono/Samples/WAMP1/WampSharp.RpcClientSample/WampSharp.RpcClientSample.csproj
+++ b/src/mono/Samples/WAMP1/WampSharp.RpcClientSample/WampSharp.RpcClientSample.csproj
@@ -60,7 +60,7 @@
- ..\..\..\packages\WebSocket4Net.0.15.0-beta4\lib\net45\WebSocket4Net.dll
+ ..\..\..\packages\WebSocket4Net.0.15.0-beta5\lib\net45\WebSocket4Net.dll
True
diff --git a/src/mono/Samples/WAMP1/WampSharp.RpcClientSample/packages.config b/src/mono/Samples/WAMP1/WampSharp.RpcClientSample/packages.config
index cd4b177ad..3ab5628f2 100644
--- a/src/mono/Samples/WAMP1/WampSharp.RpcClientSample/packages.config
+++ b/src/mono/Samples/WAMP1/WampSharp.RpcClientSample/packages.config
@@ -2,5 +2,5 @@
-
+
diff --git a/src/mono/Samples/WAMP2/WampSharp.Samples.Callee/WampSharp.Samples.Callee.csproj b/src/mono/Samples/WAMP2/WampSharp.Samples.Callee/WampSharp.Samples.Callee.csproj
index f647313c2..3d283d753 100644
--- a/src/mono/Samples/WAMP2/WampSharp.Samples.Callee/WampSharp.Samples.Callee.csproj
+++ b/src/mono/Samples/WAMP2/WampSharp.Samples.Callee/WampSharp.Samples.Callee.csproj
@@ -76,7 +76,7 @@
- ..\..\..\packages\WebSocket4Net.0.15.0-beta4\lib\net45\WebSocket4Net.dll
+ ..\..\..\packages\WebSocket4Net.0.15.0-beta5\lib\net45\WebSocket4Net.dll
True
diff --git a/src/mono/Samples/WAMP2/WampSharp.Samples.Callee/packages.config b/src/mono/Samples/WAMP2/WampSharp.Samples.Callee/packages.config
index df6d87db6..246b2dc2c 100644
--- a/src/mono/Samples/WAMP2/WampSharp.Samples.Callee/packages.config
+++ b/src/mono/Samples/WAMP2/WampSharp.Samples.Callee/packages.config
@@ -6,5 +6,5 @@
-
+
diff --git a/src/mono/Samples/WAMP2/WampSharp.Samples.Caller/WampSharp.Samples.Caller.csproj b/src/mono/Samples/WAMP2/WampSharp.Samples.Caller/WampSharp.Samples.Caller.csproj
index 10785557b..56376fab8 100644
--- a/src/mono/Samples/WAMP2/WampSharp.Samples.Caller/WampSharp.Samples.Caller.csproj
+++ b/src/mono/Samples/WAMP2/WampSharp.Samples.Caller/WampSharp.Samples.Caller.csproj
@@ -76,7 +76,7 @@
- ..\..\..\packages\WebSocket4Net.0.15.0-beta4\lib\net45\WebSocket4Net.dll
+ ..\..\..\packages\WebSocket4Net.0.15.0-beta5\lib\net45\WebSocket4Net.dll
True
diff --git a/src/mono/Samples/WAMP2/WampSharp.Samples.Caller/packages.config b/src/mono/Samples/WAMP2/WampSharp.Samples.Caller/packages.config
index df6d87db6..246b2dc2c 100644
--- a/src/mono/Samples/WAMP2/WampSharp.Samples.Caller/packages.config
+++ b/src/mono/Samples/WAMP2/WampSharp.Samples.Caller/packages.config
@@ -6,5 +6,5 @@
-
+
diff --git a/src/mono/Samples/WAMP2/WampSharp.Samples.EdgeJs/WampSharp.Samples.EdgeJs.csproj b/src/mono/Samples/WAMP2/WampSharp.Samples.EdgeJs/WampSharp.Samples.EdgeJs.csproj
index 2af0ee265..0042686f9 100644
--- a/src/mono/Samples/WAMP2/WampSharp.Samples.EdgeJs/WampSharp.Samples.EdgeJs.csproj
+++ b/src/mono/Samples/WAMP2/WampSharp.Samples.EdgeJs/WampSharp.Samples.EdgeJs.csproj
@@ -79,7 +79,7 @@
- ..\..\..\packages\WebSocket4Net.0.15.0-beta4\lib\net45\WebSocket4Net.dll
+ ..\..\..\packages\WebSocket4Net.0.15.0-beta5\lib\net45\WebSocket4Net.dll
True
diff --git a/src/mono/Samples/WAMP2/WampSharp.Samples.EdgeJs/packages.config b/src/mono/Samples/WAMP2/WampSharp.Samples.EdgeJs/packages.config
index c088044a8..fcb7e2002 100644
--- a/src/mono/Samples/WAMP2/WampSharp.Samples.EdgeJs/packages.config
+++ b/src/mono/Samples/WAMP2/WampSharp.Samples.EdgeJs/packages.config
@@ -7,5 +7,5 @@
-
+
diff --git a/src/mono/Samples/WAMP2/WampSharp.Samples.Publisher/WampSharp.Samples.Publisher.csproj b/src/mono/Samples/WAMP2/WampSharp.Samples.Publisher/WampSharp.Samples.Publisher.csproj
index 9dc0455b5..571bd09ab 100644
--- a/src/mono/Samples/WAMP2/WampSharp.Samples.Publisher/WampSharp.Samples.Publisher.csproj
+++ b/src/mono/Samples/WAMP2/WampSharp.Samples.Publisher/WampSharp.Samples.Publisher.csproj
@@ -76,7 +76,7 @@
- ..\..\..\packages\WebSocket4Net.0.15.0-beta4\lib\net45\WebSocket4Net.dll
+ ..\..\..\packages\WebSocket4Net.0.15.0-beta5\lib\net45\WebSocket4Net.dll
True
diff --git a/src/mono/Samples/WAMP2/WampSharp.Samples.Publisher/packages.config b/src/mono/Samples/WAMP2/WampSharp.Samples.Publisher/packages.config
index df6d87db6..246b2dc2c 100644
--- a/src/mono/Samples/WAMP2/WampSharp.Samples.Publisher/packages.config
+++ b/src/mono/Samples/WAMP2/WampSharp.Samples.Publisher/packages.config
@@ -6,5 +6,5 @@
-
+
diff --git a/src/mono/Samples/WAMP2/WampSharp.Samples.Subscriber/WampSharp.Samples.Subscriber.csproj b/src/mono/Samples/WAMP2/WampSharp.Samples.Subscriber/WampSharp.Samples.Subscriber.csproj
index f1eb3ad97..24ed84ae7 100644
--- a/src/mono/Samples/WAMP2/WampSharp.Samples.Subscriber/WampSharp.Samples.Subscriber.csproj
+++ b/src/mono/Samples/WAMP2/WampSharp.Samples.Subscriber/WampSharp.Samples.Subscriber.csproj
@@ -72,7 +72,7 @@
- ..\..\..\packages\WebSocket4Net.0.15.0-beta4\lib\net45\WebSocket4Net.dll
+ ..\..\..\packages\WebSocket4Net.0.15.0-beta5\lib\net45\WebSocket4Net.dll
True
diff --git a/src/mono/Samples/WAMP2/WampSharp.Samples.Subscriber/packages.config b/src/mono/Samples/WAMP2/WampSharp.Samples.Subscriber/packages.config
index d955552c0..9cae0f8ed 100644
--- a/src/mono/Samples/WAMP2/WampSharp.Samples.Subscriber/packages.config
+++ b/src/mono/Samples/WAMP2/WampSharp.Samples.Subscriber/packages.config
@@ -5,5 +5,5 @@
-
+
diff --git a/src/mono/Samples/WAMP2/WampSharp.Samples.WampCra.Client/WampSharp.Samples.WampCra.Client.csproj b/src/mono/Samples/WAMP2/WampSharp.Samples.WampCra.Client/WampSharp.Samples.WampCra.Client.csproj
index 4c7f90a56..d7bd8d59a 100644
--- a/src/mono/Samples/WAMP2/WampSharp.Samples.WampCra.Client/WampSharp.Samples.WampCra.Client.csproj
+++ b/src/mono/Samples/WAMP2/WampSharp.Samples.WampCra.Client/WampSharp.Samples.WampCra.Client.csproj
@@ -54,7 +54,7 @@
- ..\..\..\packages\WebSocket4Net.0.15.0-beta4\lib\net45\WebSocket4Net.dll
+ ..\..\..\packages\WebSocket4Net.0.15.0-beta5\lib\net45\WebSocket4Net.dll
True
diff --git a/src/mono/Samples/WAMP2/WampSharp.Samples.WampCra.Client/packages.config b/src/mono/Samples/WAMP2/WampSharp.Samples.WampCra.Client/packages.config
index 50f0d072c..230303925 100644
--- a/src/mono/Samples/WAMP2/WampSharp.Samples.WampCra.Client/packages.config
+++ b/src/mono/Samples/WAMP2/WampSharp.Samples.WampCra.Client/packages.config
@@ -1,5 +1,5 @@
-
+
diff --git a/src/mono/Tests/WampSharp.Tests.Wampv2/WampSharp.Tests.Wampv2.csproj b/src/mono/Tests/WampSharp.Tests.Wampv2/WampSharp.Tests.Wampv2.csproj
index 212f5e96c..92011e156 100644
--- a/src/mono/Tests/WampSharp.Tests.Wampv2/WampSharp.Tests.Wampv2.csproj
+++ b/src/mono/Tests/WampSharp.Tests.Wampv2/WampSharp.Tests.Wampv2.csproj
@@ -19,15 +19,16 @@
full
false
bin\Debug\
- TRACE;DEBUG;NET45;MONO
+ TRACE;DEBUG;NET45;MONO WAMPCRA
prompt
4
+ false
pdbonly
true
bin\Release\
- TRACE;NET45;MONO
+ TRACE;NET45;MONO WAMPCRA
prompt
4
@@ -60,6 +61,10 @@
True
+
+ ..\..\packages\System.ValueTuple.4.0.0-rc3-24212-01\lib\netstandard1.1\System.ValueTuple.dll
+ True
+
@@ -136,6 +141,12 @@
Integration\RpcProxies\IErrorsService.cs
+
+ Integration\RpcProxies\ILongValueTuplesServiceProxy.cs
+
+
+ Integration\RpcProxies\INamedTupleComplexResultService.cs
+
Integration\RpcProxies\ISlowSquareService.cs
@@ -151,12 +162,27 @@
Integration\RpcServices\ErrorsService.cs
+
+ Integration\RpcServices\LongValueTuplesCalleeService.cs
+
+
+ Integration\RpcServices\LongValueTuplesService.cs
+
+
+ Integration\RpcServices\NamedTupleComplexResultService.cs
+
+
+ Integration\RpcServices\PositionalTupleComplexResultService.cs
+
Integration\RpcServices\SlowSquareService.cs
Integration\RpcServices\TimeService.cs
+
+ Integration\PubSubSubjectTupleTests.cs
+
Integration\SerializedValue.cs
diff --git a/src/mono/Tests/WampSharp.Tests.Wampv2/packages.config b/src/mono/Tests/WampSharp.Tests.Wampv2/packages.config
index 5c753a17e..35da4bee2 100644
--- a/src/mono/Tests/WampSharp.Tests.Wampv2/packages.config
+++ b/src/mono/Tests/WampSharp.Tests.Wampv2/packages.config
@@ -4,4 +4,5 @@
+
diff --git a/src/mono/WampSharp.Default.Client/WampSharp.Default.Client.csproj b/src/mono/WampSharp.Default.Client/WampSharp.Default.Client.csproj
index 5616b9d90..c99718c0a 100644
--- a/src/mono/WampSharp.Default.Client/WampSharp.Default.Client.csproj
+++ b/src/mono/WampSharp.Default.Client/WampSharp.Default.Client.csproj
@@ -51,7 +51,7 @@
- ..\packages\WebSocket4Net.0.15.0-beta4\lib\net45\WebSocket4Net.dll
+ ..\packages\WebSocket4Net.0.15.0-beta5\lib\net45\WebSocket4Net.dll
True
diff --git a/src/mono/WampSharp.Default.Client/packages.config b/src/mono/WampSharp.Default.Client/packages.config
index cd4b177ad..3ab5628f2 100644
--- a/src/mono/WampSharp.Default.Client/packages.config
+++ b/src/mono/WampSharp.Default.Client/packages.config
@@ -2,5 +2,5 @@
-
+
diff --git a/src/mono/WampSharp.WAMP1.Default/WampSharp.WAMP1.Default.csproj b/src/mono/WampSharp.WAMP1.Default/WampSharp.WAMP1.Default.csproj
index 1b3df1234..239f5f8a8 100644
--- a/src/mono/WampSharp.WAMP1.Default/WampSharp.WAMP1.Default.csproj
+++ b/src/mono/WampSharp.WAMP1.Default/WampSharp.WAMP1.Default.csproj
@@ -54,7 +54,7 @@
- ..\packages\WebSocket4Net.0.15.0-beta4\lib\net45\WebSocket4Net.dll
+ ..\packages\WebSocket4Net.0.15.0-beta5\lib\net45\WebSocket4Net.dll
True
diff --git a/src/mono/WampSharp.WAMP1.Default/packages.config b/src/mono/WampSharp.WAMP1.Default/packages.config
index 755dd83c3..3c44de189 100644
--- a/src/mono/WampSharp.WAMP1.Default/packages.config
+++ b/src/mono/WampSharp.WAMP1.Default/packages.config
@@ -3,5 +3,5 @@
-
+
diff --git a/src/mono/WampSharp/WampSharp.csproj b/src/mono/WampSharp/WampSharp.csproj
index 24e86f9ce..f96636706 100644
--- a/src/mono/WampSharp/WampSharp.csproj
+++ b/src/mono/WampSharp/WampSharp.csproj
@@ -59,8 +59,12 @@
True
-
- ..\packages\Microsoft.Tpl.Dataflow.4.5.24\lib\portable-net45+win8+wpa81\System.Threading.Tasks.Dataflow.dll
+
+ ..\packages\System.Threading.Tasks.Dataflow.4.6.0\lib\netstandard1.1\System.Threading.Tasks.Dataflow.dll
+ True
+
+
+ ..\packages\System.ValueTuple.4.0.0-rc3-24212-01\lib\netstandard1.1\System.ValueTuple.dll
True
@@ -283,6 +287,24 @@
Core\Utilities\ThreadSafeRandom.cs
+
+ Core\Utilities\ValueTuple\ValueTuple.cs
+
+
+ Core\Utilities\ValueTuple\ValueTupleArrayConverter.cs
+
+
+ Core\Utilities\ValueTuple\ValueTupleConverter.cs
+
+
+ Core\Utilities\ValueTuple\ValueTupleDictionaryConverter.cs
+
+
+ Core\Utilities\ValueTuple\ValueTupleDictionaryConverterBuilder.cs
+
+
+ Core\Utilities\ValueTuple\ValueTupleTypeExtensions.cs
+
Properties\AssemblyInfo.cs
@@ -295,6 +317,9 @@
WAMP2\V2\Api\CalleeProxy\CachedCalleeProxyInterceptor.cs
+
+ WAMP2\V2\Api\CalleeProxy\Callbacks\Async\OperationResultExtractor.cs
+
WAMP2\V2\Api\CalleeProxy\CalleeProxyBase.cs
@@ -334,9 +359,15 @@
WAMP2\V2\Api\CalleeProxy\ClientInvocationHandler.cs
+
+ WAMP2\V2\Api\CalleeProxy\Callbacks\Async\ValueTupleValueExtractor.cs
+
WAMP2\V2\Api\CalleeProxy\WampIncompatibleCalleeProxyMethodException.cs
+
+ WAMP2\V2\Api\Rx\WampTupleTopicSubject.cs
+
WAMP2\V2\Api\DelegatePubSub\EventHandlerGenerator.cs
@@ -358,9 +389,21 @@
WAMP2\V2\Api\DelegatePubSub\WampSubscriberRegistrar.cs
+
+ WAMP2\V2\Api\Rx\IWampEventValueTupleConverter.cs
+
+
+ WAMP2\V2\Api\Rx\SerializedValueFormatter.cs
+
+
+ WAMP2\V2\Api\Rx\WampEventValueTupleConverter.cs
+
WAMP2\V2\Authentication\Restriction\WampRestrictedUris.cs
+
+ WAMP2\V2\Core\ArgumentUnpackerHelper.cs
+
WAMP2\V2\Core\Contracts\WampAuthenticationMethods.cs
@@ -532,6 +575,9 @@
WAMP2\V2\Client\Session\WampAuthenticationNotImplementedException.cs
+
+ WAMP2\V2\Core\Contracts\WampInvalidArgumentException.cs
+
WAMP2\V2\Core\Contracts\WampInvokePolicy.cs
@@ -799,9 +845,6 @@
WAMP2\V2\Rpc\Callee\Reflection\ICalleeRegistrationInterceptor.cs
-
- WAMP2\V2\Rpc\Callee\Reflection\CallerProgress.cs
-
WAMP2\V2\Rpc\Callee\Reflection\MethodInfoValidation.cs
@@ -811,6 +854,27 @@
WAMP2\V2\Rpc\Callee\Reflection\ProgressiveAsyncMethodInfoRpcOperation.cs
+
+ WAMP2\V2\Rpc\Callee\Reflection\ResultExtractor\EmptyResultExtractor.cs
+
+
+ WAMP2\V2\Rpc\Callee\Reflection\ResultExtractor\IWampResultExtractor.cs
+
+
+ WAMP2\V2\Rpc\Callee\Reflection\ResultExtractor\MultiResultExtractor.cs
+
+
+ WAMP2\V2\Rpc\Callee\Reflection\ResultExtractor\NamedTupleExtractor.cs
+
+
+ WAMP2\V2\Rpc\Callee\Reflection\ResultExtractor\PositionalTupleExtractor.cs
+
+
+ WAMP2\V2\Rpc\Callee\Reflection\ResultExtractor\SingleResultExtractor.cs
+
+
+ WAMP2\V2\Rpc\Callee\Reflection\ResultExtractor\WampResultExtractor.cs
+
WAMP2\V2\Rpc\Dealer\ExactRpcOperationCatalog.cs
diff --git a/src/mono/WampSharp/packages.config b/src/mono/WampSharp/packages.config
index d15a875a6..cfb220def 100644
--- a/src/mono/WampSharp/packages.config
+++ b/src/mono/WampSharp/packages.config
@@ -1,6 +1,7 @@
-
+
+
diff --git a/src/net40/Default/WampSharp.WebSocket4Net/WampSharp.WebSocket4Net.csproj b/src/net40/Default/WampSharp.WebSocket4Net/WampSharp.WebSocket4Net.csproj
index 1c15f5ca1..12fcaee9f 100644
--- a/src/net40/Default/WampSharp.WebSocket4Net/WampSharp.WebSocket4Net.csproj
+++ b/src/net40/Default/WampSharp.WebSocket4Net/WampSharp.WebSocket4Net.csproj
@@ -46,7 +46,7 @@
- ..\..\packages\WebSocket4Net.0.15.0-beta4\lib\net40\WebSocket4Net.dll
+ ..\..\packages\WebSocket4Net.0.15.0-beta5\lib\net40\WebSocket4Net.dll
True
@@ -54,12 +54,18 @@
Properties\AssemblyInfo.cs
+
+ WAMP2\V2\Fluent\IWebSocket4NetTransportSyntax.cs
+
WAMP2\V2\Fluent\WebSocket4NetActivator.cs
WAMP2\V2\Fluent\WebSocket4NetChannelFactoryExtensions.cs
+
+ WAMP2\V2\Fluent\WebSocket4NetTransportSyntax.cs
+
WebSocket4Net\WebSocket4NetBinaryConnection.cs
diff --git a/src/net40/Default/WampSharp.WebSocket4Net/packages.config b/src/net40/Default/WampSharp.WebSocket4Net/packages.config
index aaed1eaf2..a9341805a 100644
--- a/src/net40/Default/WampSharp.WebSocket4Net/packages.config
+++ b/src/net40/Default/WampSharp.WebSocket4Net/packages.config
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/src/net40/Samples/WAMP1/WampSharp.CraClientSample/WampSharp.CraClientSample.csproj b/src/net40/Samples/WAMP1/WampSharp.CraClientSample/WampSharp.CraClientSample.csproj
index a0d7c593a..3bb0b1148 100644
--- a/src/net40/Samples/WAMP1/WampSharp.CraClientSample/WampSharp.CraClientSample.csproj
+++ b/src/net40/Samples/WAMP1/WampSharp.CraClientSample/WampSharp.CraClientSample.csproj
@@ -65,7 +65,7 @@
- ..\..\..\packages\WebSocket4Net.0.15.0-beta4\lib\net40\WebSocket4Net.dll
+ ..\..\..\packages\WebSocket4Net.0.15.0-beta5\lib\net40\WebSocket4Net.dll
True
diff --git a/src/net40/Samples/WAMP1/WampSharp.CraClientSample/packages.config b/src/net40/Samples/WAMP1/WampSharp.CraClientSample/packages.config
index 6c5b9bfd2..585b78e11 100644
--- a/src/net40/Samples/WAMP1/WampSharp.CraClientSample/packages.config
+++ b/src/net40/Samples/WAMP1/WampSharp.CraClientSample/packages.config
@@ -7,5 +7,5 @@
-
+
\ No newline at end of file
diff --git a/src/net40/Samples/WAMP1/WampSharp.RpcClientSample/WampSharp.RpcClientSample.csproj b/src/net40/Samples/WAMP1/WampSharp.RpcClientSample/WampSharp.RpcClientSample.csproj
index 0e9d532a6..5063646c0 100644
--- a/src/net40/Samples/WAMP1/WampSharp.RpcClientSample/WampSharp.RpcClientSample.csproj
+++ b/src/net40/Samples/WAMP1/WampSharp.RpcClientSample/WampSharp.RpcClientSample.csproj
@@ -55,7 +55,7 @@
- ..\..\..\packages\WebSocket4Net.0.15.0-beta4\lib\net40\WebSocket4Net.dll
+ ..\..\..\packages\WebSocket4Net.0.15.0-beta5\lib\net40\WebSocket4Net.dll
True
diff --git a/src/net40/Samples/WAMP1/WampSharp.RpcClientSample/packages.config b/src/net40/Samples/WAMP1/WampSharp.RpcClientSample/packages.config
index dd2fadccd..ffdcd9559 100644
--- a/src/net40/Samples/WAMP1/WampSharp.RpcClientSample/packages.config
+++ b/src/net40/Samples/WAMP1/WampSharp.RpcClientSample/packages.config
@@ -3,5 +3,5 @@
-
+
\ No newline at end of file
diff --git a/src/net40/Samples/WAMP2/WampSharp.Samples.Callee/WampSharp.Samples.Callee.csproj b/src/net40/Samples/WAMP2/WampSharp.Samples.Callee/WampSharp.Samples.Callee.csproj
index 956de01d4..95b8f6981 100644
--- a/src/net40/Samples/WAMP2/WampSharp.Samples.Callee/WampSharp.Samples.Callee.csproj
+++ b/src/net40/Samples/WAMP2/WampSharp.Samples.Callee/WampSharp.Samples.Callee.csproj
@@ -83,7 +83,7 @@
- ..\..\..\packages\WebSocket4Net.0.15.0-beta4\lib\net40\WebSocket4Net.dll
+ ..\..\..\packages\WebSocket4Net.0.15.0-beta5\lib\net40\WebSocket4Net.dll
True
diff --git a/src/net40/Samples/WAMP2/WampSharp.Samples.Callee/packages.config b/src/net40/Samples/WAMP2/WampSharp.Samples.Callee/packages.config
index eb198a249..4e4288622 100644
--- a/src/net40/Samples/WAMP2/WampSharp.Samples.Callee/packages.config
+++ b/src/net40/Samples/WAMP2/WampSharp.Samples.Callee/packages.config
@@ -11,5 +11,5 @@
-
+
\ No newline at end of file
diff --git a/src/net40/Samples/WAMP2/WampSharp.Samples.Caller/WampSharp.Samples.Caller.csproj b/src/net40/Samples/WAMP2/WampSharp.Samples.Caller/WampSharp.Samples.Caller.csproj
index c6da87f69..2b63d2998 100644
--- a/src/net40/Samples/WAMP2/WampSharp.Samples.Caller/WampSharp.Samples.Caller.csproj
+++ b/src/net40/Samples/WAMP2/WampSharp.Samples.Caller/WampSharp.Samples.Caller.csproj
@@ -83,7 +83,7 @@
- ..\..\..\packages\WebSocket4Net.0.15.0-beta4\lib\net40\WebSocket4Net.dll
+ ..\..\..\packages\WebSocket4Net.0.15.0-beta5\lib\net40\WebSocket4Net.dll
True
diff --git a/src/net40/Samples/WAMP2/WampSharp.Samples.Caller/packages.config b/src/net40/Samples/WAMP2/WampSharp.Samples.Caller/packages.config
index eb198a249..4e4288622 100644
--- a/src/net40/Samples/WAMP2/WampSharp.Samples.Caller/packages.config
+++ b/src/net40/Samples/WAMP2/WampSharp.Samples.Caller/packages.config
@@ -11,5 +11,5 @@
-
+
\ No newline at end of file
diff --git a/src/net40/Samples/WAMP2/WampSharp.Samples.Publisher/WampSharp.Samples.Publisher.csproj b/src/net40/Samples/WAMP2/WampSharp.Samples.Publisher/WampSharp.Samples.Publisher.csproj
index 4d4653b5b..16cbd4913 100644
--- a/src/net40/Samples/WAMP2/WampSharp.Samples.Publisher/WampSharp.Samples.Publisher.csproj
+++ b/src/net40/Samples/WAMP2/WampSharp.Samples.Publisher/WampSharp.Samples.Publisher.csproj
@@ -82,7 +82,7 @@
- ..\..\..\packages\WebSocket4Net.0.15.0-beta4\lib\net40\WebSocket4Net.dll
+ ..\..\..\packages\WebSocket4Net.0.15.0-beta5\lib\net40\WebSocket4Net.dll
True
diff --git a/src/net40/Samples/WAMP2/WampSharp.Samples.Publisher/packages.config b/src/net40/Samples/WAMP2/WampSharp.Samples.Publisher/packages.config
index eb198a249..4e4288622 100644
--- a/src/net40/Samples/WAMP2/WampSharp.Samples.Publisher/packages.config
+++ b/src/net40/Samples/WAMP2/WampSharp.Samples.Publisher/packages.config
@@ -11,5 +11,5 @@
-
+
\ No newline at end of file
diff --git a/src/net40/Samples/WAMP2/WampSharp.Samples.Subscriber/WampSharp.Samples.Subscriber.csproj b/src/net40/Samples/WAMP2/WampSharp.Samples.Subscriber/WampSharp.Samples.Subscriber.csproj
index 30960e295..10b20ba7e 100644
--- a/src/net40/Samples/WAMP2/WampSharp.Samples.Subscriber/WampSharp.Samples.Subscriber.csproj
+++ b/src/net40/Samples/WAMP2/WampSharp.Samples.Subscriber/WampSharp.Samples.Subscriber.csproj
@@ -79,7 +79,7 @@
- ..\..\..\packages\WebSocket4Net.0.15.0-beta4\lib\net40\WebSocket4Net.dll
+ ..\..\..\packages\WebSocket4Net.0.15.0-beta5\lib\net40\WebSocket4Net.dll
True
diff --git a/src/net40/Samples/WAMP2/WampSharp.Samples.Subscriber/packages.config b/src/net40/Samples/WAMP2/WampSharp.Samples.Subscriber/packages.config
index fca5bfda0..8611c2c11 100644
--- a/src/net40/Samples/WAMP2/WampSharp.Samples.Subscriber/packages.config
+++ b/src/net40/Samples/WAMP2/WampSharp.Samples.Subscriber/packages.config
@@ -10,5 +10,5 @@
-
+
\ No newline at end of file
diff --git a/src/net40/Samples/WAMP2/WampSharp.Samples.WampCra.Client/WampSharp.Samples.WampCra.Client.csproj b/src/net40/Samples/WAMP2/WampSharp.Samples.WampCra.Client/WampSharp.Samples.WampCra.Client.csproj
index e6efdd009..44547f4a8 100644
--- a/src/net40/Samples/WAMP2/WampSharp.Samples.WampCra.Client/WampSharp.Samples.WampCra.Client.csproj
+++ b/src/net40/Samples/WAMP2/WampSharp.Samples.WampCra.Client/WampSharp.Samples.WampCra.Client.csproj
@@ -57,7 +57,7 @@
- ..\..\..\packages\WebSocket4Net.0.15.0-beta4\lib\net40\WebSocket4Net.dll
+ ..\..\..\packages\WebSocket4Net.0.15.0-beta5\lib\net40\WebSocket4Net.dll
True
diff --git a/src/net40/Samples/WAMP2/WampSharp.Samples.WampCra.Client/packages.config b/src/net40/Samples/WAMP2/WampSharp.Samples.WampCra.Client/packages.config
index 830a106cb..dd35a73fe 100644
--- a/src/net40/Samples/WAMP2/WampSharp.Samples.WampCra.Client/packages.config
+++ b/src/net40/Samples/WAMP2/WampSharp.Samples.WampCra.Client/packages.config
@@ -4,5 +4,5 @@
-
+
\ No newline at end of file
diff --git a/src/net40/Tests/WampSharp.Tests.Wampv2/WampSharp.Tests.Wampv2.csproj b/src/net40/Tests/WampSharp.Tests.Wampv2/WampSharp.Tests.Wampv2.csproj
index 779c1e7c6..211c1f8bc 100644
--- a/src/net40/Tests/WampSharp.Tests.Wampv2/WampSharp.Tests.Wampv2.csproj
+++ b/src/net40/Tests/WampSharp.Tests.Wampv2/WampSharp.Tests.Wampv2.csproj
@@ -135,6 +135,12 @@
Integration\RpcProxies\IErrorsService.cs
+
+ Integration\RpcProxies\ILongValueTuplesServiceProxy.cs
+
+
+ Integration\RpcProxies\INamedTupleComplexResultService.cs
+
Integration\RpcProxies\ISlowSquareService.cs
@@ -150,12 +156,27 @@
Integration\RpcServices\ErrorsService.cs
+
+ Integration\RpcServices\LongValueTuplesCalleeService.cs
+
+
+ Integration\RpcServices\LongValueTuplesService.cs
+
+
+ Integration\RpcServices\NamedTupleComplexResultService.cs
+
+
+ Integration\RpcServices\PositionalTupleComplexResultService.cs
+
Integration\RpcServices\SlowSquareService.cs
Integration\RpcServices\TimeService.cs
+
+ Integration\PubSubSubjectTupleTests.cs
+
Integration\SerializedValue.cs
diff --git a/src/net40/WampSharp.Default.Client/WampSharp.Default.Client.csproj b/src/net40/WampSharp.Default.Client/WampSharp.Default.Client.csproj
index b86537ca3..fb8418e64 100644
--- a/src/net40/WampSharp.Default.Client/WampSharp.Default.Client.csproj
+++ b/src/net40/WampSharp.Default.Client/WampSharp.Default.Client.csproj
@@ -51,7 +51,7 @@
- ..\packages\WebSocket4Net.0.15.0-beta4\lib\net40\WebSocket4Net.dll
+ ..\packages\WebSocket4Net.0.15.0-beta5\lib\net40\WebSocket4Net.dll
True
diff --git a/src/net40/WampSharp.Default.Client/packages.config b/src/net40/WampSharp.Default.Client/packages.config
index e5f7d731a..44153b851 100644
--- a/src/net40/WampSharp.Default.Client/packages.config
+++ b/src/net40/WampSharp.Default.Client/packages.config
@@ -2,5 +2,5 @@
-
+
\ No newline at end of file
diff --git a/src/net40/WampSharp.WAMP1.Default/WampSharp.WAMP1.Default.csproj b/src/net40/WampSharp.WAMP1.Default/WampSharp.WAMP1.Default.csproj
index d00c88acb..3eca2a74f 100644
--- a/src/net40/WampSharp.WAMP1.Default/WampSharp.WAMP1.Default.csproj
+++ b/src/net40/WampSharp.WAMP1.Default/WampSharp.WAMP1.Default.csproj
@@ -54,7 +54,7 @@
- ..\packages\WebSocket4Net.0.15.0-beta4\lib\net40\WebSocket4Net.dll
+ ..\packages\WebSocket4Net.0.15.0-beta5\lib\net40\WebSocket4Net.dll
True
diff --git a/src/net40/WampSharp.WAMP1.Default/packages.config b/src/net40/WampSharp.WAMP1.Default/packages.config
index 782750eb0..4ffb17b34 100644
--- a/src/net40/WampSharp.WAMP1.Default/packages.config
+++ b/src/net40/WampSharp.WAMP1.Default/packages.config
@@ -3,5 +3,5 @@
-
+
\ No newline at end of file
diff --git a/src/net40/WampSharp/WampSharp.csproj b/src/net40/WampSharp/WampSharp.csproj
index 7435b4430..951d8b381 100644
--- a/src/net40/WampSharp/WampSharp.csproj
+++ b/src/net40/WampSharp/WampSharp.csproj
@@ -290,6 +290,24 @@
Core\Utilities\ThreadSafeRandom.cs
+
+ Core\Utilities\ValueTuple\ValueTuple.cs
+
+
+ Core\Utilities\ValueTuple\ValueTupleArrayConverter.cs
+
+
+ Core\Utilities\ValueTuple\ValueTupleConverter.cs
+
+
+ Core\Utilities\ValueTuple\ValueTupleDictionaryConverter.cs
+
+
+ Core\Utilities\ValueTuple\ValueTupleDictionaryConverterBuilder.cs
+
+
+ Core\Utilities\ValueTuple\ValueTupleTypeExtensions.cs
+
Properties\AssemblyInfo.cs
@@ -302,6 +320,9 @@
WAMP2\V2\Api\CalleeProxy\CachedCalleeProxyInterceptor.cs
+
+ WAMP2\V2\Api\CalleeProxy\Callbacks\Async\OperationResultExtractor.cs
+
WAMP2\V2\Api\CalleeProxy\CalleeProxyBase.cs
@@ -341,9 +362,15 @@
WAMP2\V2\Api\CalleeProxy\ClientInvocationHandler.cs
+
+ WAMP2\V2\Api\CalleeProxy\Callbacks\Async\ValueTupleValueExtractor.cs
+
WAMP2\V2\Api\CalleeProxy\WampIncompatibleCalleeProxyMethodException.cs
+
+ WAMP2\V2\Api\Rx\WampTupleTopicSubject.cs
+
WAMP2\V2\Api\DelegatePubSub\EventHandlerGenerator.cs
@@ -365,9 +392,21 @@
WAMP2\V2\Api\DelegatePubSub\WampSubscriberRegistrar.cs
+
+ WAMP2\V2\Api\Rx\IWampEventValueTupleConverter.cs
+
+
+ WAMP2\V2\Api\Rx\SerializedValueFormatter.cs
+
+
+ WAMP2\V2\Api\Rx\WampEventValueTupleConverter.cs
+
WAMP2\V2\Authentication\Restriction\WampRestrictedUris.cs
+
+ WAMP2\V2\Core\ArgumentUnpackerHelper.cs
+
WAMP2\V2\Core\Contracts\WampAuthenticationMethods.cs
@@ -539,6 +578,9 @@
WAMP2\V2\Client\Session\WampAuthenticationNotImplementedException.cs
+
+ WAMP2\V2\Core\Contracts\WampInvalidArgumentException.cs
+
WAMP2\V2\Core\Contracts\WampInvokePolicy.cs
@@ -806,9 +848,6 @@
WAMP2\V2\Rpc\Callee\Reflection\ICalleeRegistrationInterceptor.cs
-
- WAMP2\V2\Rpc\Callee\Reflection\CallerProgress.cs
-
WAMP2\V2\Rpc\Callee\Reflection\MethodInfoValidation.cs
@@ -818,6 +857,27 @@
WAMP2\V2\Rpc\Callee\Reflection\ProgressiveAsyncMethodInfoRpcOperation.cs
+
+ WAMP2\V2\Rpc\Callee\Reflection\ResultExtractor\EmptyResultExtractor.cs
+
+
+ WAMP2\V2\Rpc\Callee\Reflection\ResultExtractor\IWampResultExtractor.cs
+
+
+ WAMP2\V2\Rpc\Callee\Reflection\ResultExtractor\MultiResultExtractor.cs
+
+
+ WAMP2\V2\Rpc\Callee\Reflection\ResultExtractor\NamedTupleExtractor.cs
+
+
+ WAMP2\V2\Rpc\Callee\Reflection\ResultExtractor\PositionalTupleExtractor.cs
+
+
+ WAMP2\V2\Rpc\Callee\Reflection\ResultExtractor\SingleResultExtractor.cs
+
+
+ WAMP2\V2\Rpc\Callee\Reflection\ResultExtractor\WampResultExtractor.cs
+
WAMP2\V2\Rpc\Dealer\ExactRpcOperationCatalog.cs
diff --git a/src/net45/.nuget/NuGet.exe b/src/net45/.nuget/NuGet.exe
index 9ca66594f..6bb79fe53 100644
Binary files a/src/net45/.nuget/NuGet.exe and b/src/net45/.nuget/NuGet.exe differ
diff --git a/src/net45/Default/WampSharp.NewtonsoftJson/Newtonsoft/JTokenMessageParser.cs b/src/net45/Default/WampSharp.NewtonsoftJson/Newtonsoft/JTokenMessageParser.cs
index 901972df8..ccefccc37 100644
--- a/src/net45/Default/WampSharp.NewtonsoftJson/Newtonsoft/JTokenMessageParser.cs
+++ b/src/net45/Default/WampSharp.NewtonsoftJson/Newtonsoft/JTokenMessageParser.cs
@@ -26,12 +26,12 @@ public WampMessage Parse(string text)
{
try
{
- mLogger.DebugFormat("Trying to parse message {0}", text);
+ mLogger.DebugFormat("Trying to parse message {JsonMessage}", text);
return mMessageFormatter.Parse(JToken.Parse(text));
}
catch (Exception ex)
{
- mLogger.ErrorFormat(ex, "Failed parsing message {0}", text);
+ mLogger.ErrorFormat(ex, "Failed parsing message {JsonMessage}", text);
throw;
}
}
@@ -45,7 +45,7 @@ public string Format(WampMessage
+
+ ..\..\packages\System.ValueTuple.4.0.0-rc3-24212-01\lib\netstandard1.1\System.ValueTuple.dll
+ True
+
@@ -93,13 +98,20 @@
+
+
+
+
+
+
+
diff --git a/src/net45/Tests/WampSharp.Tests.Wampv2/packages.config b/src/net45/Tests/WampSharp.Tests.Wampv2/packages.config
index 04a84340c..b0657ad3f 100644
--- a/src/net45/Tests/WampSharp.Tests.Wampv2/packages.config
+++ b/src/net45/Tests/WampSharp.Tests.Wampv2/packages.config
@@ -7,4 +7,5 @@
+
\ No newline at end of file
diff --git a/src/net45/WampSharp.Default.Client/WampSharp.Default.Client.csproj b/src/net45/WampSharp.Default.Client/WampSharp.Default.Client.csproj
index a32d81094..b61b64718 100644
--- a/src/net45/WampSharp.Default.Client/WampSharp.Default.Client.csproj
+++ b/src/net45/WampSharp.Default.Client/WampSharp.Default.Client.csproj
@@ -51,7 +51,7 @@
- ..\packages\WebSocket4Net.0.15.0-beta4\lib\net45\WebSocket4Net.dll
+ ..\packages\WebSocket4Net.0.15.0-beta5\lib\net45\WebSocket4Net.dll
True
diff --git a/src/net45/WampSharp.Default.Client/packages.config b/src/net45/WampSharp.Default.Client/packages.config
index e1e00513d..a5c0aaf7d 100644
--- a/src/net45/WampSharp.Default.Client/packages.config
+++ b/src/net45/WampSharp.Default.Client/packages.config
@@ -2,5 +2,5 @@
-
+
\ No newline at end of file
diff --git a/src/net45/WampSharp.WAMP1.Default/WampSharp.WAMP1.Default.csproj b/src/net45/WampSharp.WAMP1.Default/WampSharp.WAMP1.Default.csproj
index b6f82a2e5..0bd408b2f 100644
--- a/src/net45/WampSharp.WAMP1.Default/WampSharp.WAMP1.Default.csproj
+++ b/src/net45/WampSharp.WAMP1.Default/WampSharp.WAMP1.Default.csproj
@@ -54,7 +54,7 @@
- ..\packages\WebSocket4Net.0.15.0-beta4\lib\net45\WebSocket4Net.dll
+ ..\packages\WebSocket4Net.0.15.0-beta5\lib\net45\WebSocket4Net.dll
True
diff --git a/src/net45/WampSharp.WAMP1.Default/packages.config b/src/net45/WampSharp.WAMP1.Default/packages.config
index ff2f6eb3e..144c5e1de 100644
--- a/src/net45/WampSharp.WAMP1.Default/packages.config
+++ b/src/net45/WampSharp.WAMP1.Default/packages.config
@@ -3,5 +3,5 @@
-
+
\ No newline at end of file
diff --git a/src/net45/WampSharp.WAMP1/WAMP1/V1/Core/Listener/WampListener.cs b/src/net45/WampSharp.WAMP1/WAMP1/V1/Core/Listener/WampListener.cs
index ae23e39f0..3793cf3bc 100644
--- a/src/net45/WampSharp.WAMP1/WAMP1/V1/Core/Listener/WampListener.cs
+++ b/src/net45/WampSharp.WAMP1/WAMP1/V1/Core/Listener/WampListener.cs
@@ -50,7 +50,7 @@ protected override void OnConnectionOpen(IWampConnection connection)
IWampClient client = ClientContainer.GetClient(connection);
- mLogger.DebugFormat("Client connected, session id: {0}", client.SessionId);
+ mLogger.DebugFormat("Client connected, session id: {SessionId}", client.SessionId);
client.Welcome(client.SessionId, 1, "WampSharp");
@@ -74,7 +74,7 @@ protected override void OnCloseConnection(IWampConnection connection)
if (mLogger.IsDebugEnabled())
{
IWampClient client = ClientContainer.GetClient(connection);
- mLogger.DebugFormat("Client disconnected, session id: {0}", client.SessionId);
+ mLogger.DebugFormat("Client disconnected, session id: {SessionId}", client.SessionId);
}
base.OnCloseConnection(connection);
diff --git a/src/net45/WampSharp/Core/Dispatch/Handler/WampMethodBuilder.cs b/src/net45/WampSharp/Core/Dispatch/Handler/WampMethodBuilder.cs
index c91703887..cfa4bec8c 100644
--- a/src/net45/WampSharp/Core/Dispatch/Handler/WampMethodBuilder.cs
+++ b/src/net45/WampSharp/Core/Dispatch/Handler/WampMethodBuilder.cs
@@ -143,7 +143,7 @@ private object DeserializeArgument(ParameterInfo parameter, TMessage argument)
}
catch (Exception ex)
{
- mLogger.ErrorFormat(ex, "Failed deserializing {0}", parameter.Name);
+ mLogger.ErrorFormat(ex, "Failed deserializing {ParameterName}", parameter.Name);
throw;
}
}
diff --git a/src/net45/WampSharp/Core/Dispatch/WampIncomingMessageHandler.cs b/src/net45/WampSharp/Core/Dispatch/WampIncomingMessageHandler.cs
index 49ce41bea..05931e6a6 100644
--- a/src/net45/WampSharp/Core/Dispatch/WampIncomingMessageHandler.cs
+++ b/src/net45/WampSharp/Core/Dispatch/WampIncomingMessageHandler.cs
@@ -44,7 +44,7 @@ public void HandleMessage(TClient client, WampMessage message)
if (method != null)
{
- mLogger.DebugFormat("Mapped message to method: {0}", method.Method);
+ mLogger.DebugFormat("Mapped message to method: {Method}", method.Method);
Action> action = mDelegateCache.Get(method);
action(client, message);
}
diff --git a/src/net45/WampSharp/Core/Proxy/WampOutgoingRequestSerializer.cs b/src/net45/WampSharp/Core/Proxy/WampOutgoingRequestSerializer.cs
index a982e44b1..38df64c00 100644
--- a/src/net45/WampSharp/Core/Proxy/WampOutgoingRequestSerializer.cs
+++ b/src/net45/WampSharp/Core/Proxy/WampOutgoingRequestSerializer.cs
@@ -34,7 +34,7 @@ public WampOutgoingRequestSerializer(IWampFormatter formatter)
public WampMessage SerializeRequest(MethodInfo method, object[] arguments)
{
- mLogger.DebugFormat("Calling remote peer proxy method: {0}", method);
+ mLogger.DebugFormat("Calling remote peer proxy method: {Method}", method);
WampMethodInfo wampMethod = GetWampMethod(method);
diff --git a/src/net45/WampSharp/Core/Utilities/CustomAttributeExtensions.cs b/src/net45/WampSharp/Core/Utilities/CustomAttributeExtensions.cs
index 0a7bbfb4f..a2c80588b 100644
--- a/src/net45/WampSharp/Core/Utilities/CustomAttributeExtensions.cs
+++ b/src/net45/WampSharp/Core/Utilities/CustomAttributeExtensions.cs
@@ -18,6 +18,11 @@ public static bool IsDefined(this MemberInfo element, Type attributeType, bool i
{
return Attribute.IsDefined(element, attributeType, inherit);
}
+
+ public static bool IsDefined(this ParameterInfo parameter, Type attributeType, bool inherit = true)
+ {
+ return Attribute.IsDefined(parameter, attributeType, inherit);
+ }
}
#endif
}
\ No newline at end of file
diff --git a/src/net45/WampSharp/Core/Utilities/TypeExtensions.cs b/src/net45/WampSharp/Core/Utilities/TypeExtensions.cs
index 4636698cc..2ae5aabef 100644
--- a/src/net45/WampSharp/Core/Utilities/TypeExtensions.cs
+++ b/src/net45/WampSharp/Core/Utilities/TypeExtensions.cs
@@ -98,6 +98,19 @@ public static GenericParameterAttributes GenericParameterAttributes(this Type ty
#endif
}
+#if PCL
+ public static bool IsDefined(this Type type, Type attributeType, bool inherit)
+ {
+ return type.GetTypeInfo().IsDefined(attributeType, inherit);
+ }
+
+ public static T GetCustomAttribute(this Type type, bool inherit = true)
+ where T : Attribute
+ {
+ return type.GetTypeInfo().GetCustomAttribute(inherit);
+ }
+#endif
+
#if NET40
public static Type AsType(this Type type)
{
@@ -123,7 +136,14 @@ public static bool IsAssignableFrom(this Type interfaceType, Type type)
public static Type[] GetGenericArguments(this Type type)
{
- return type.GenericTypeArguments;
+ TypeInfo typeInfo = type.GetTypeInfo();
+
+ if (typeInfo.IsGenericTypeDefinition)
+ {
+ return typeInfo.GenericTypeParameters;
+ }
+
+ return typeInfo.GenericTypeArguments;
}
public static MethodInfo GetMethod(this Type type, string methodName)
@@ -145,6 +165,21 @@ public static bool IsInstanceOfType(this Type type, object instance)
{
return type.IsAssignableFrom(instance.GetType());
}
+
+ public static IEnumerable GetProperties(this Type type)
+ {
+ return type.GetTypeInfo().DeclaredProperties;
+ }
+
+ public static IEnumerable GetFields(this Type type)
+ {
+ return type.GetTypeInfo().DeclaredFields;
+ }
+
+ public static FieldInfo GetField(this Type type, string name)
+ {
+ return type.GetTypeInfo().GetDeclaredField(name);
+ }
#endif
}
}
\ No newline at end of file
diff --git a/src/net45/WampSharp/Core/Utilities/ValueTuple/ValueTuple.cs b/src/net45/WampSharp/Core/Utilities/ValueTuple/ValueTuple.cs
new file mode 100644
index 000000000..38a45b060
--- /dev/null
+++ b/src/net45/WampSharp/Core/Utilities/ValueTuple/ValueTuple.cs
@@ -0,0 +1,55 @@
+#if NET40
+
+using System;
+using System.Collections.Generic;
+
+namespace System.Runtime.CompilerServices
+{
+ [AttributeUsage(AttributeTargets.ReturnValue)]
+ internal sealed class TupleElementNamesAttribute : Attribute
+ {
+ public IList TransformNames { get; private set; }
+
+ public TupleElementNamesAttribute(string[] transformNames)
+ {
+ TransformNames = transformNames;
+ }
+ }
+}
+
+namespace System
+{
+ internal class ValueTuple
+ {
+ }
+
+ internal class ValueTuple
+ {
+ }
+
+ internal class ValueTuple
+ {
+ }
+
+ internal class ValueTuple
+ {
+ }
+
+ internal class ValueTuple
+ {
+ }
+
+ internal class ValueTuple
+ {
+ }
+
+ internal class ValueTuple
+ {
+ }
+
+ internal class ValueTuple
+ {
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/src/net45/WampSharp/Core/Utilities/ValueTuple/ValueTupleArrayConverter.cs b/src/net45/WampSharp/Core/Utilities/ValueTuple/ValueTupleArrayConverter.cs
new file mode 100644
index 000000000..0bc113821
--- /dev/null
+++ b/src/net45/WampSharp/Core/Utilities/ValueTuple/ValueTupleArrayConverter.cs
@@ -0,0 +1,118 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Reflection;
+
+namespace WampSharp.Core.Utilities.ValueTuple
+{
+ internal static class ValueTupleArrayConverter
+ {
+ public static readonly ValueTupleArrayConverter Value = new ValueTupleArrayConverter(typeof(TValueTuple));
+ }
+
+ internal class ValueTupleArrayConverter : ValueTupleConverter
+ {
+ private readonly Type mTupleType;
+
+ private static readonly MethodInfo mGetMethod =
+ Method.Get(() => Get())
+ .GetGenericMethodDefinition();
+
+ private readonly Func mToArrayDelegate;
+
+ private readonly Func mToTupleDelegate;
+ private readonly int mTupleLegnth;
+
+ public ValueTupleArrayConverter(Type tupleType) : base(tupleType)
+ {
+ mTupleType = tupleType;
+ mTupleLegnth = tupleType.GetValueTupleLength();
+ mToArrayDelegate = BuildToArray();
+ mToTupleDelegate = BuildToTuple();
+ }
+
+ public object ToTuple(object[] array)
+ {
+ if (array.Length != mTupleLegnth)
+ {
+ throw new ArgumentException("Expected an array of size " + mTupleLegnth, "array");
+ }
+
+ return mToTupleDelegate(array);
+ }
+
+ public object[] ToArray(object valueTuple)
+ {
+ return mToArrayDelegate(valueTuple);
+ }
+
+ private Func BuildToTuple()
+ {
+ ParameterExpression array =
+ Expression.Parameter(typeof(object[]), "array");
+
+ int tupleLength = mTupleType.GetValueTupleLength();
+
+ IEnumerable tupleItemValues =
+ Enumerable.Range(0, tupleLength)
+ .Select(index => Expression.ArrayIndex(array, Expression.Constant(index)));
+
+ // new ValueTuple((T1)array[0],(T2)array[1], ...)
+
+ Func result =
+ BuildToTuple
+ (array, tupleItemValues);
+
+ return result;
+ }
+
+ private Func BuildToArray()
+ {
+ ParameterExpression tupleResult =
+ Expression.Parameter(typeof(object), "tupleResult");
+
+ ParameterExpression casted =
+ Expression.Variable(mTupleType, "casted");
+
+ BinaryExpression assignment =
+ Expression.Assign(casted, Expression.Convert(tupleResult, mTupleType));
+
+ IEnumerable parameters =
+ GetTupleItemsExpressions(casted, mTupleType);
+
+ NewArrayExpression arrayInit =
+ Expression.NewArrayInit(typeof(object), parameters);
+
+ BlockExpression body =
+ Expression.Block(variables: new[] { casted },
+ expressions: new Expression[]
+ {
+ assignment,
+ arrayInit
+ });
+
+ Expression> lambda =
+ Expression.Lambda>
+ (body: body,
+ parameters: tupleResult);
+
+ Func result = lambda.Compile();
+
+ return result;
+ }
+
+ public static ValueTupleArrayConverter Get(Type type)
+ {
+ object result =
+ mGetMethod.MakeGenericMethod(type).Invoke(null, new object[]{});
+
+ return (ValueTupleArrayConverter) result;
+ }
+
+ public static ValueTupleArrayConverter Get()
+ {
+ return ValueTupleArrayConverter.Value;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/net45/WampSharp/Core/Utilities/ValueTuple/ValueTupleConverter.cs b/src/net45/WampSharp/Core/Utilities/ValueTuple/ValueTupleConverter.cs
new file mode 100644
index 000000000..68dd09f43
--- /dev/null
+++ b/src/net45/WampSharp/Core/Utilities/ValueTuple/ValueTupleConverter.cs
@@ -0,0 +1,123 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Reflection;
+
+namespace WampSharp.Core.Utilities.ValueTuple
+{
+ internal abstract class ValueTupleConverter
+ {
+ private const int MaxTupleSize = 7;
+ private readonly Type mTupleType;
+
+ protected ValueTupleConverter(Type tupleType)
+ {
+ ThrowHelper.ValidateSimpleTuple(tupleType);
+ mTupleType = tupleType;
+ }
+
+ protected Func BuildToTuple(ParameterExpression sourceParameter, IEnumerable tupleItemValuesExpressions)
+ {
+ NewExpression tupleCreation =
+ GetTupleNewExpression(tupleItemValuesExpressions, mTupleType);
+
+ // new ValueTuple((T1)dictionary["$argument1Name"],(T2)dictionary["$argument2Name"], ...)
+
+ UnaryExpression boxed =
+ Expression.Convert(tupleCreation, typeof(object));
+
+ var lambda = Expression.Lambda>
+ (boxed, sourceParameter);
+
+ var compiled = lambda.Compile();
+
+ return compiled;
+ }
+
+ public static NewExpression GetTupleNewExpression(IEnumerable tupleItemValuesExpressions, Type tupleType)
+ {
+ Type[] genericArguments = tupleType.GetGenericArguments();
+
+ IEnumerable tupleSimpleArguments = tupleItemValuesExpressions.Zip
+ (genericArguments.Take(MaxTupleSize),
+ (expression, type) =>
+ Expression.Convert(expression,
+ type));
+
+ IEnumerable tupleConstructorArguments = tupleSimpleArguments;
+
+ if (genericArguments.Length > MaxTupleSize)
+ {
+ IEnumerable nestedItemValueExpressions =
+ tupleItemValuesExpressions.Skip(MaxTupleSize);
+
+ Type nestedTupleType = genericArguments.Last();
+
+ NewExpression newExpression =
+ GetTupleNewExpression(nestedItemValueExpressions, nestedTupleType);
+
+ tupleConstructorArguments = tupleConstructorArguments.Concat(new[] {newExpression});
+ }
+
+ NewExpression tupleCreation =
+ Expression.New(tupleType.GetConstructors().FirstOrDefault(),
+ tupleConstructorArguments);
+
+ return tupleCreation;
+ }
+
+ public static IEnumerable GetTupleItemsExpressions
+ (Expression tupleInstance,
+ Type tupleType)
+ {
+ IEnumerable result =
+ InnerGetTupleItemsExpressions(tupleInstance, tupleType);
+
+ return result.Select(x => Expression.Convert(x, typeof(object)));
+ }
+
+ protected static IEnumerable InnerGetTupleItemsExpressions
+ (Expression tupleInstance,
+ Type tupleType)
+ {
+ IEnumerable simpleFields =
+ tupleType.GetFields()
+ .Where(x => x.Name.StartsWith("Item"))
+ .OrderBy(x => x.Name)
+ .Select(field => Expression.Field(tupleInstance, field));
+
+ IEnumerable result = simpleFields;
+
+ Type[] genericArguments = tupleType.GetGenericArguments();
+
+ if (genericArguments.Length > MaxTupleSize)
+ {
+ FieldInfo restField = tupleType.GetField("Rest");
+
+ MemberExpression nestedTupleInstance =
+ Expression.Field(tupleInstance, restField);
+
+ Type nestedTupleType = genericArguments.Last();
+
+ IEnumerable nestedFields =
+ InnerGetTupleItemsExpressions(nestedTupleInstance, nestedTupleType);
+
+ result = result.Concat(nestedFields);
+ }
+
+ return result;
+ }
+
+ protected static class ThrowHelper
+ {
+ public static void ValidateSimpleTuple(Type tupleType)
+ {
+ if (!tupleType.IsValueTuple())
+ {
+ throw new ArgumentException("Expected a ValueTuple type", "tupleType");
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/net45/WampSharp/Core/Utilities/ValueTuple/ValueTupleDictionaryConverter.cs b/src/net45/WampSharp/Core/Utilities/ValueTuple/ValueTupleDictionaryConverter.cs
new file mode 100644
index 000000000..4823e36d1
--- /dev/null
+++ b/src/net45/WampSharp/Core/Utilities/ValueTuple/ValueTupleDictionaryConverter.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+
+namespace WampSharp.Core.Utilities.ValueTuple
+{
+ internal class ValueTupleDictionaryConverter : ValueTupleConverter
+ {
+ private readonly Func> mToDictionaryDelegate;
+
+ private readonly Func, object> mToTupleDelegate;
+
+ public ValueTupleDictionaryConverter(Type tupleType, Func> toDictionaryDelegate, Func, object> toTupleDelegate) :
+ base(tupleType)
+ {
+ Validate(tupleType);
+ mToDictionaryDelegate = toDictionaryDelegate;
+ mToTupleDelegate = toTupleDelegate;
+ }
+
+ private void Validate(Type tupleType)
+ {
+ ThrowHelper.ValidateSimpleTuple(tupleType);
+ }
+
+ public object ToTuple(IDictionary dictionary)
+ {
+ return mToTupleDelegate(dictionary);
+ }
+
+ public IDictionary ToDictionary(object valueTuple)
+ {
+ return mToDictionaryDelegate(valueTuple);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/net45/WampSharp/Core/Utilities/ValueTuple/ValueTupleDictionaryConverterBuilder.cs b/src/net45/WampSharp/Core/Utilities/ValueTuple/ValueTupleDictionaryConverterBuilder.cs
new file mode 100644
index 000000000..10078c051
--- /dev/null
+++ b/src/net45/WampSharp/Core/Utilities/ValueTuple/ValueTupleDictionaryConverterBuilder.cs
@@ -0,0 +1,154 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Reflection;
+
+namespace WampSharp.Core.Utilities.ValueTuple
+{
+ internal static class ValueTupleDictionaryConverterBuilder
+ {
+ private static readonly MethodInfo mBuildMethod = Method.Get(() => Build(default(IList)))
+ .GetGenericMethodDefinition();
+
+ public static ValueTupleDictionaryConverter Build(Type tupleType, IList transformNames)
+ {
+ MethodInfo methodToInvoke =
+ mBuildMethod.MakeGenericMethod(tupleType);
+
+ object result =
+ methodToInvoke.Invoke(null, new object[] {transformNames});
+
+ return (ValueTupleDictionaryConverter) result;
+ }
+
+ public static ValueTupleDictionaryConverter Build(IList transformNames)
+ {
+ return ValueTupleDictionaryConverterBuilder.Get(transformNames);
+ }
+ }
+
+ internal class ValueTupleDictionaryConverterBuilder
+ {
+ private static readonly MethodInfo mDictionaryAddMethod =
+ Method.Get((IDictionary dictionary) =>
+ dictionary.Add(default(string), default(object)));
+
+ private static readonly PropertyInfo mDictionaryIndexer =
+ typeof(IDictionary).GetProperties().
+ FirstOrDefault(x => x.GetIndexParameters().Any());
+
+ private static readonly PropertyInfo mListIndexer =
+ typeof(IList).GetProperties().
+ FirstOrDefault(x => x.GetIndexParameters().Any());
+
+ private static Func, IDictionary> mToDictionary = GetToDictionaryBuilder();
+ private static Func, IList, object> mToTuple = GetToTupleBuilder();
+
+ public static ValueTupleDictionaryConverter Get(IList transformNames)
+ {
+ Func> toDictionaryDelegate =
+ tuple => mToDictionary(tuple, transformNames);
+
+ Func, object> toTupleDelegate =
+ dictionary => mToTuple(dictionary, transformNames);
+
+ return new ValueTupleDictionaryConverter(typeof(TTuple), toDictionaryDelegate, toTupleDelegate);
+ }
+
+ private static Func, IDictionary> GetToDictionaryBuilder()
+ {
+ Type tupleType = typeof(TTuple);
+
+ ParameterExpression transformNamesParameter =
+ Expression.Parameter(typeof(IList), "transformNamesParameter");
+
+ ParameterExpression tupleParameter =
+ Expression.Parameter(typeof(object), "tupleParameter");
+
+ ParameterExpression casted =
+ Expression.Variable(tupleType, "casted");
+
+ BinaryExpression assignment =
+ Expression.Assign(casted, Expression.Convert(tupleParameter, tupleType));
+
+ IEnumerable tupleItemsExpressions =
+ ValueTupleConverter.GetTupleItemsExpressions(casted, tupleType);
+
+ ListInitExpression dictionaryInit =
+ Expression.ListInit
+ (Expression.New(typeof(Dictionary)),
+ tupleItemsExpressions.Select((parameter, i) => Expression.ElementInit
+ (mDictionaryAddMethod,
+ Expression.Property(transformNamesParameter, mListIndexer, Expression.Constant(i)),
+ parameter)));
+
+ BlockExpression body =
+ Expression.Block(variables: new[] { casted },
+ expressions: new Expression[]
+ {
+ assignment,
+ dictionaryInit
+ });
+
+ Expression, IDictionary>> lambda =
+ Expression.Lambda, IDictionary>>
+ (body,
+ tupleParameter,
+ transformNamesParameter);
+
+ Func, IDictionary> result = lambda.Compile();
+
+ return result;
+ }
+
+ private static Func, IList, object> GetToTupleBuilder()
+ {
+ ParameterExpression dictionary =
+ Expression.Parameter(typeof(IDictionary), "dictionary");
+
+ ParameterExpression transformNames =
+ Expression.Parameter(typeof(IList), "transformNames");
+
+ int valueTupleLength = typeof(TTuple).GetValueTupleLength();
+
+ var tupleElements =
+ Enumerable.Range(0, valueTupleLength);
+
+ IEnumerable itemsValues =
+ tupleElements.Select
+ (index =>
+ Expression.MakeIndex(dictionary, mDictionaryIndexer,
+ new Expression[]
+ {
+ Expression.Property(transformNames,
+ mListIndexer,
+ Expression.Constant(index))
+ }));
+
+ // new ValueTuple((T1)dictionary[transformNames[0]],(T2)dictionary[transformNames[1]], ...)
+ Func, IList, object> result =
+ GetToTupleBuilder(dictionary, itemsValues, transformNames);
+
+ return result;
+ }
+
+ private static Func, IList, object> GetToTupleBuilder(ParameterExpression dictionary, IEnumerable itemsValues, ParameterExpression transformNames)
+ {
+ // new ValueTuple((T1)dictionary[transformNames[0]],(T2)dictionary[transformNames[1]], ...)
+ NewExpression tupleCreation =
+ ValueTupleConverter.GetTupleNewExpression(itemsValues, typeof(TTuple));
+
+ UnaryExpression boxed =
+ Expression.Convert(tupleCreation, typeof(object));
+
+ var lambda =
+ Expression.Lambda, IList, object>>
+ (boxed, dictionary, transformNames);
+
+ var result = lambda.Compile();
+
+ return result;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/net45/WampSharp/Core/Utilities/ValueTuple/ValueTupleTypeExtensions.cs b/src/net45/WampSharp/Core/Utilities/ValueTuple/ValueTupleTypeExtensions.cs
new file mode 100644
index 000000000..aa9eeaca3
--- /dev/null
+++ b/src/net45/WampSharp/Core/Utilities/ValueTuple/ValueTupleTypeExtensions.cs
@@ -0,0 +1,113 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+
+namespace WampSharp.Core.Utilities.ValueTuple
+{
+ internal static class ValueTupleTypeExtensions
+ {
+ public static bool IsValueTuple(this Type type)
+ {
+ if (!type.IsGenericType())
+ {
+ return false;
+ }
+
+ Type genericTypeDefinition = type.GetGenericTypeDefinition();
+
+ if ((genericTypeDefinition == typeof(ValueTuple<>)) ||
+ (genericTypeDefinition == typeof(ValueTuple<,>)) ||
+ (genericTypeDefinition == typeof(ValueTuple<,,>)) ||
+ (genericTypeDefinition == typeof(ValueTuple<,,,>)) ||
+ (genericTypeDefinition == typeof(ValueTuple<,,,,>)) ||
+ (genericTypeDefinition == typeof(ValueTuple<,,,,,>)) ||
+ (genericTypeDefinition == typeof(ValueTuple<,,,,,,>)) ||
+ (genericTypeDefinition == typeof(ValueTuple<,,,,,,,>)))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static int GetValueTupleLength(this Type type)
+ {
+ if (!type.IsValueTuple())
+ {
+ throw new ArgumentException("Expected a ValueTuple type", "type");
+ }
+
+ Type genericTypeDefinition = type.GetGenericTypeDefinition();
+
+ Type[] genericArguments = genericTypeDefinition.GetGenericArguments();
+
+ int tupleLength = genericArguments.Length;
+ if (!genericTypeDefinition.IsLongTuple())
+ {
+ return tupleLength;
+ }
+ else
+ {
+ Type last = type.GetGenericArguments().Last();
+
+ return (tupleLength - 1) +
+ last.GetValueTupleLength();
+ }
+ }
+
+ public static bool IsLongTuple(this Type tupleType)
+ {
+ return tupleType.IsGenericType() &&
+ tupleType.GetGenericTypeDefinition() == typeof(ValueTuple<,,,,,,,>);
+ }
+
+ public static bool IsValidTupleType(this Type tupleType)
+ {
+ if (tupleType.IsValueTuple())
+ {
+ if (tupleType.IsLongTuple())
+ {
+ Type rest = tupleType.GetGenericArguments().Last();
+
+ if (!rest.IsValidTupleType())
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ public static IEnumerable GetValueTupleElementTypes(this Type tupleType)
+ {
+ Type[] genericArguments = tupleType.GetGenericArguments();
+
+ if (!tupleType.IsLongTuple())
+ {
+ return genericArguments;
+ }
+ else
+ {
+ IEnumerable firstElements =
+ genericArguments.Take(genericArguments.Length - 1);
+
+ Type nestedTupleType = genericArguments.Last();
+
+ IEnumerable rest = nestedTupleType.GetValueTupleElementTypes();
+
+ return firstElements.Concat(rest);
+ }
+ }
+
+ public static bool ReturnsTuple(this MethodInfo method)
+ {
+ Type unwrappedReturnType = TaskExtensions.UnwrapReturnType(method.ReturnType);
+
+ return unwrappedReturnType.IsValueTuple();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/AsyncOperationCallback.cs b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/AsyncOperationCallback.cs
index f6a6598ae..5ddddc68c 100644
--- a/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/AsyncOperationCallback.cs
+++ b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/AsyncOperationCallback.cs
@@ -28,9 +28,9 @@ protected virtual void SetResult(ResultDetails details, TResult result)
mTask.SetResult(result);
}
- protected virtual TResult GetResult(IWampFormatter formatter, TMessage[] arguments)
+ protected virtual TResult GetResult(IWampFormatter formatter, TMessage[] arguments, IDictionary argumentsKeywords)
{
- return mExtractor.GetResult(formatter, arguments);
+ return mExtractor.GetResult(formatter, arguments, argumentsKeywords);
}
public void Result(IWampFormatter formatter, ResultDetails details)
@@ -46,13 +46,20 @@ public void Result(IWampFormatter formatter, ResultDetails d
public void Result(IWampFormatter formatter, ResultDetails details, TMessage[] arguments, IDictionary argumentsKeywords)
{
- SetResult(details, formatter, arguments);
+ SetResult(details, formatter, arguments, argumentsKeywords);
}
- private void SetResult(ResultDetails details, IWampFormatter formatter, TMessage[] arguments)
+ private void SetResult(ResultDetails details, IWampFormatter formatter, TMessage[] arguments, IDictionary argumentsKeywords = null)
{
- TResult result = GetResult(formatter, arguments);
- SetResult(details, result);
+ try
+ {
+ TResult result = GetResult(formatter, arguments, argumentsKeywords);
+ SetResult(details, result);
+ }
+ catch (Exception ex)
+ {
+ SetException(ex);
+ }
}
public void Error(IWampFormatter formatter, TMessage details, string error)
diff --git a/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/IOperationResultExtractor.cs b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/IOperationResultExtractor.cs
index cdc7352ad..4369d0a22 100644
--- a/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/IOperationResultExtractor.cs
+++ b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/IOperationResultExtractor.cs
@@ -1,9 +1,10 @@
+using System.Collections.Generic;
using WampSharp.Core.Serialization;
namespace WampSharp.V2.CalleeProxy
{
internal interface IOperationResultExtractor
{
- TResult GetResult(IWampFormatter formatter, TMessage[] arguments);
+ TResult GetResult(IWampFormatter formatter, TMessage[] arguments, IDictionary argumentsKeywords);
}
}
\ No newline at end of file
diff --git a/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/MultiValueExtractor.cs b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/MultiValueExtractor.cs
index 379a07fee..a0df45237 100644
--- a/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/MultiValueExtractor.cs
+++ b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/MultiValueExtractor.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using System.Linq;
using WampSharp.Core.Serialization;
@@ -9,7 +10,7 @@ internal class MultiValueExtractor : IOperationResultExtractor(IWampFormatter formatter, TMessage[] arguments)
+ public TResult[] GetResult(IWampFormatter formatter, TMessage[] arguments, IDictionary argumentsKeywords)
{
if (!arguments.Any())
{
diff --git a/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/OperationResultExtractor.cs b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/OperationResultExtractor.cs
new file mode 100644
index 000000000..e3ff1b00d
--- /dev/null
+++ b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/OperationResultExtractor.cs
@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using WampSharp.Core.Utilities;
+using WampSharp.Core.Utilities.ValueTuple;
+using WampSharp.V2.Core;
+using WampSharp.V2.Rpc;
+
+namespace WampSharp.V2.CalleeProxy
+{
+ internal class OperationResultExtractor
+ {
+ public static IOperationResultExtractor Get(MethodInfo method)
+ {
+ IOperationResultExtractor extractor;
+
+ if (typeof(T).IsValueTuple())
+ {
+ extractor = GetValueTupleOperationResultExtractor(method);
+ }
+ else if (!method.HasMultivaluedResult())
+ {
+ bool hasReturnValue = method.HasReturnValue();
+ extractor = new SingleValueExtractor(hasReturnValue);
+ }
+ else
+ {
+ Type elementType = typeof(T).GetElementType();
+
+ Type extractorType =
+ typeof(MultiValueExtractor<>).MakeGenericType(elementType);
+
+ extractor =
+ (IOperationResultExtractor)Activator.CreateInstance(extractorType);
+ }
+
+ return extractor;
+ }
+
+ private static IOperationResultExtractor GetValueTupleOperationResultExtractor(MethodInfo method)
+ {
+ ArgumentUnpacker unpacker = GetTupleArgumentUnpacker(method);
+
+ return new ValueTupleValueExtractor(unpacker);
+ }
+
+ private static ArgumentUnpacker GetTupleArgumentUnpacker(MethodInfo method)
+ {
+ Type tupleType = TaskExtensions.UnwrapReturnType(method.ReturnType);
+
+ IEnumerable transformNames = null;
+
+ if (method.ReturnParameter.IsDefined(typeof(TupleElementNamesAttribute)))
+ {
+ TupleElementNamesAttribute attribute =
+ method.ReturnParameter.GetCustomAttribute();
+
+ transformNames = attribute.TransformNames;
+ }
+
+ return ArgumentUnpackerHelper.GetValueTupleArgumentUnpacker
+ (tupleType, transformNames);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/SingleValueExtractor.cs b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/SingleValueExtractor.cs
index c027f8986..776498acb 100644
--- a/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/SingleValueExtractor.cs
+++ b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/SingleValueExtractor.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using System.Linq;
using WampSharp.Core.Serialization;
@@ -14,7 +15,7 @@ public SingleValueExtractor(bool hasReturnValue)
mHasReturnValue = hasReturnValue;
}
- public TResult GetResult(IWampFormatter formatter, TMessage[] arguments)
+ public TResult GetResult(IWampFormatter formatter, TMessage[] arguments, IDictionary argumentsKeywords)
{
if (!mHasReturnValue || !arguments.Any())
{
diff --git a/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/ValueTupleValueExtractor.cs b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/ValueTupleValueExtractor.cs
new file mode 100644
index 000000000..74f883657
--- /dev/null
+++ b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Async/ValueTupleValueExtractor.cs
@@ -0,0 +1,29 @@
+using System.Collections.Generic;
+using WampSharp.Core.Serialization;
+using WampSharp.Core.Utilities.ValueTuple;
+using WampSharp.V2.Core;
+
+namespace WampSharp.V2.CalleeProxy
+{
+ internal class ValueTupleValueExtractor : IOperationResultExtractor
+ {
+ private readonly ArgumentUnpacker mUnpacker;
+ private readonly ValueTupleArrayConverter mConverter;
+
+ public ValueTupleValueExtractor(ArgumentUnpacker unpacker)
+ {
+ mUnpacker = unpacker;
+ mConverter = ValueTupleArrayConverter.Value;
+ }
+
+ public T GetResult(IWampFormatter formatter, TMessage[] arguments, IDictionary argumentsKeywords)
+ {
+ object[] array =
+ mUnpacker.UnpackParameters(formatter, arguments, argumentsKeywords);
+
+ T result = (T) mConverter.ToTuple(array);
+
+ return result;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Sync/SyncCallback.cs b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Sync/SyncCallback.cs
index 3e4ba4073..ddc65b40b 100644
--- a/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Sync/SyncCallback.cs
+++ b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/Callbacks/Sync/SyncCallback.cs
@@ -50,7 +50,7 @@ public override void Result(IWampFormatter formatter, Result
mArguments,
outOrRefParameters);
- SetResult(formatter, arguments);
+ SetResult(formatter, arguments, argumentsKeywords);
}
catch (Exception ex)
{
@@ -59,10 +59,17 @@ public override void Result(IWampFormatter formatter, Result
}
}
- private void SetResult(IWampFormatter formatter, TMessage[] arguments)
+ private void SetResult(IWampFormatter formatter, TMessage[] arguments, IDictionary argumentKeywords = null)
{
- TResult result = mExtractor.GetResult(formatter, arguments);
- SetResult(result);
+ try
+ {
+ TResult result = mExtractor.GetResult(formatter, arguments, argumentKeywords);
+ SetResult(result);
+ }
+ catch (Exception ex)
+ {
+ SetException(ex);
+ }
}
protected void SetResult(TResult result)
diff --git a/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/CalleeProxyBase.cs b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/CalleeProxyBase.cs
index 0fa3610ef..cff614c88 100644
--- a/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/CalleeProxyBase.cs
+++ b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/CalleeProxyBase.cs
@@ -9,6 +9,10 @@ namespace WampSharp.V2.CalleeProxy
{
public class CalleeProxyBase
{
+ protected delegate T InvokeSyncDelegate(CalleeProxyBase proxy, params object[] arguments);
+ protected delegate Task InvokeAsyncDelegate(CalleeProxyBase proxy, params object[] arguments);
+ protected delegate Task InvokeProgressiveAsyncDelegate(CalleeProxyBase proxy, IProgress progress, params object[] arguments);
+
private readonly WampCalleeProxyInvocationHandler mHandler;
private readonly ICalleeProxyInterceptor mInterceptor;
@@ -19,6 +23,59 @@ public CalleeProxyBase(IWampRealmProxy realmProxy,
mHandler = new ClientInvocationHandler(realmProxy);
}
+ protected static InvokeSyncDelegate GetInvokeSync(MethodInfo method)
+ {
+ IOperationResultExtractor extractor = GetExtractor(method);
+ return GetInvokeSync(method, extractor);
+ }
+
+ protected static InvokeAsyncDelegate GetInvokeAsync(MethodInfo method)
+ {
+ IOperationResultExtractor extractor = GetExtractor(method);
+ return GetInvokeAsync(method, extractor);
+ }
+
+ protected static InvokeProgressiveAsyncDelegate GetInvokeProgressiveAsync(MethodInfo method)
+ {
+ IOperationResultExtractor extractor = GetExtractor(method);
+ return GetInvokeProgressiveAsync(method, extractor);
+ }
+
+ private static IOperationResultExtractor GetExtractor(MethodInfo method)
+ {
+ return OperationResultExtractor.Get(method);
+ }
+
+
+ private static InvokeSyncDelegate GetInvokeSync(MethodBase method, IOperationResultExtractor extractor)
+ {
+ InvokeSyncDelegate result =
+ (proxy, arguments) =>
+ proxy.InvokeSync(method, extractor, arguments);
+
+ return result;
+ }
+
+ private static InvokeAsyncDelegate GetInvokeAsync(MethodBase method, IOperationResultExtractor extractor)
+ {
+ InvokeAsyncDelegate result =
+ (proxy, arguments) =>
+ proxy.InvokeAsync(method, extractor, arguments);
+
+ return result;
+ }
+
+ private static InvokeProgressiveAsyncDelegate
+ GetInvokeProgressiveAsync(MethodBase method,
+ IOperationResultExtractor extractor)
+ {
+ InvokeProgressiveAsyncDelegate result =
+ (proxy, progress, arguments) =>
+ proxy.InvokeProgressiveAsync(method, progress, extractor, arguments);
+
+ return result;
+ }
+
protected T SingleInvokeSync(MethodBase method, params object[] arguments)
{
return InvokeSync(method, new SingleValueExtractor(true), arguments);
@@ -103,21 +160,11 @@ private Task InvokeProgressiveAsync
progress);
}
- protected static MethodInfo GetMethodInfo(Expression expression)
- {
- return Method.Get(expression);
- }
-
protected static MethodInfo GetMethodInfo(Expression> expression)
{
return Method.Get(expression);
}
- protected static MethodInfo GetMethodInfo(Func> expressionFactory)
- {
- return Method.Get(expressionFactory());
- }
-
protected static MethodInfo GetMethodInfo(Func>> expressionFactory)
{
return Method.Get(expressionFactory());
diff --git a/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/CalleeProxyInterceptorBase.cs b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/CalleeProxyInterceptorBase.cs
index c7708591d..367be0993 100644
--- a/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/CalleeProxyInterceptorBase.cs
+++ b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/CalleeProxyInterceptorBase.cs
@@ -1,8 +1,13 @@
#if CASTLE || DISPATCH_PROXY
using System;
+using System.Collections.Generic;
+using System.Linq;
using System.Reflection;
+using System.Runtime.CompilerServices;
using Castle.DynamicProxy;
using WampSharp.Core.Utilities;
+using WampSharp.Core.Utilities.ValueTuple;
+using WampSharp.V2.Core;
using WampSharp.V2.Rpc;
namespace WampSharp.V2.CalleeProxy
@@ -65,7 +70,7 @@ public CalleeProxyInterceptorBase(MethodInfo method, IWampCalleeProxyInvocationH
ICalleeProxyInterceptor interceptor)
: base(method, handler, interceptor)
{
- mExtractor = GetOperationResultExtractor(method);
+ mExtractor = OperationResultExtractor.Get(method);
}
public IOperationResultExtractor Extractor
@@ -75,29 +80,6 @@ public IOperationResultExtractor Extractor
return mExtractor;
}
}
-
- private static IOperationResultExtractor GetOperationResultExtractor(MethodInfo method)
- {
- IOperationResultExtractor extractor;
-
- if (!method.HasMultivaluedResult())
- {
- bool hasReturnValue = method.HasReturnValue();
- extractor = new SingleValueExtractor(hasReturnValue);
- }
- else
- {
- Type elementType = typeof(T).GetElementType();
-
- Type extractorType =
- typeof(MultiValueExtractor<>).MakeGenericType(elementType);
-
- extractor =
- (IOperationResultExtractor)Activator.CreateInstance(extractorType);
- }
-
- return extractor;
- }
}
}
#endif
\ No newline at end of file
diff --git a/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/CalleeProxyInterceptorFactory.cs b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/CalleeProxyInterceptorFactory.cs
index 9d483692b..5f422f0ac 100644
--- a/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/CalleeProxyInterceptorFactory.cs
+++ b/src/net45/WampSharp/WAMP2/V2/Api/CalleeProxy/CalleeProxyInterceptorFactory.cs
@@ -33,6 +33,8 @@ private static Type GetRelevantInterceptorType(MethodInfo method)
if (!typeof(Task).IsAssignableFrom(returnType))
{
+ MethodInfoValidation.ValidateTupleReturnType(method);
+
genericArgument = returnType == typeof(void) ? typeof(object) : returnType;
interceptorType = typeof(SyncCalleeProxyInterceptor<>);
}
diff --git a/src/net45/WampSharp/WAMP2/V2/Api/Client/WampRealmProxyServiceProvider.cs b/src/net45/WampSharp/WAMP2/V2/Api/Client/WampRealmProxyServiceProvider.cs
index c6ef80611..5a8013ab9 100644
--- a/src/net45/WampSharp/WAMP2/V2/Api/Client/WampRealmProxyServiceProvider.cs
+++ b/src/net45/WampSharp/WAMP2/V2/Api/Client/WampRealmProxyServiceProvider.cs
@@ -35,16 +35,41 @@ public Task RegisterCallee(object instance)
}
public Task RegisterCallee(object instance, ICalleeRegistrationInterceptor interceptor)
+ {
+ return RegisterCallee(instance.GetType(), () => instance, interceptor);
+ }
+
+ public Task RegisterCallee(Type type, Func instanceProvider)
+ {
+ return RegisterCallee(type, instanceProvider, CalleeRegistrationInterceptor.Default);
+ }
+
+
+ public Task RegisterCallee(Func instanceProvider,
+ ICalleeRegistrationInterceptor interceptor)
+ where TService : class
+ {
+ return RegisterCallee(typeof(TService), instanceProvider, interceptor);
+ }
+
+
+ public Task RegisterCallee(Func instanceProvider)
+ where TService : class
+ {
+ return RegisterCallee(typeof(TService), instanceProvider);
+ }
+
+ public Task RegisterCallee(Type type, Func instanceProvider, ICalleeRegistrationInterceptor interceptor)
{
IEnumerable operationsToRegister =
- mExtractor.ExtractOperations(instance, interceptor);
+ mExtractor.ExtractOperations(type, instanceProvider, interceptor);
- List> registrations =
+ List> registrations =
new List>();
foreach (OperationToRegister operationToRegister in operationsToRegister)
{
- Task task =
+ Task task =
mProxy.RpcCatalog.Register(operationToRegister.Operation, operationToRegister.Options);
registrations.Add(task);
@@ -81,6 +106,15 @@ public IWampSubject GetSubject(string topicUri)
return result;
}
+ public ISubject GetSubject(string topicUri, IWampEventValueTupleConverter converter)
+ {
+ IWampSubject subject = GetSubject(topicUri);
+
+ WampTupleTopicSubject result = new WampTupleTopicSubject(subject, converter);
+
+ return result;
+ }
+
public IDisposable RegisterPublisher(object instance)
{
return RegisterPublisher(instance, new PublisherRegistrationInterceptor());
diff --git a/src/net45/WampSharp/WAMP2/V2/Api/IWampRealmServiceProvider.cs b/src/net45/WampSharp/WAMP2/V2/Api/IWampRealmServiceProvider.cs
index 584cfeed3..d1c3df367 100644
--- a/src/net45/WampSharp/WAMP2/V2/Api/IWampRealmServiceProvider.cs
+++ b/src/net45/WampSharp/WAMP2/V2/Api/IWampRealmServiceProvider.cs
@@ -30,7 +30,47 @@ public interface IWampRealmServiceProvider
/// A task that is completed when all methods are registered - its result is a
/// - disposing it will unregister the instance.
Task RegisterCallee(object instance, ICalleeRegistrationInterceptor interceptor);
-
+
+ ///
+ /// Registers an instance of a type having methods decorated with
+ /// to the realm.
+ ///
+ /// The type of the service to register.
+ /// A delegate that creates an instance of the service type per call.
+ /// A task that is completed when all methods are registered - its result is a
+ /// - disposing it will unregister the instance.
+ Task RegisterCallee(Type serviceType, Func instanceProvider);
+
+ ///
+ /// Registers an instance of a type having methods decorated with
+ /// to the realm.
+ ///
+ /// The type of the service to register.
+ /// A delegate that creates an instance of the service type per call.
+ /// An object which allows registration customization.
+ /// A task that is completed when all methods are registered - its result is a
+ /// - disposing it will unregister the instance.
+ Task RegisterCallee(Type serviceType, Func instanceProvider, ICalleeRegistrationInterceptor interceptor);
+
+ ///
+ /// Registers an instance of a type having methods decorated with
+ /// to the realm.
+ ///
+ /// A delegate that creates an instance per call.
+ /// A task that is completed when all methods are registered - its result is a
+ /// - disposing it will unregister the instance.
+ Task RegisterCallee(Func instanceProvider) where TService : class;
+
+ ///
+ /// Registers an instance of a type having methods decorated with
+ /// to the realm.
+ ///
+ /// A delegate that creates an instance per call.
+ /// An object which allows registration customization.
+ /// A task that is completed when all methods are registered - its result is a
+ /// - disposing it will unregister the instance.
+ Task RegisterCallee(Func instanceProvider, ICalleeRegistrationInterceptor interceptor) where TService : class;
+
///
/// Gets a proxy of a callee registered in the realm.
///
@@ -98,5 +138,20 @@ public interface IWampRealmServiceProvider
/// A Task that is finished when SUBSCRIBE is complete - its result is a
/// - disposing it will unsubscribe from the topic.
Task RegisterSubscriber(object instance, ISubscriberRegistrationInterceptor interceptor);
+
+#if !NET40
+
+ ///
+ /// Gets a representing a
+ /// WAMP topic in the realm.
+ ///
+ /// The WAMP topic uri.
+ /// An interface responsible for converting s into s
+ /// and vice versa
+ /// The requested subject.
+ ISubject GetSubject(string topicUri, IWampEventValueTupleConverter tupleConverter);
+
+#endif
+
}
}
\ No newline at end of file
diff --git a/src/net45/WampSharp/WAMP2/V2/Api/Rx/IWampEventValueTupleConverter.cs b/src/net45/WampSharp/WAMP2/V2/Api/Rx/IWampEventValueTupleConverter.cs
new file mode 100644
index 000000000..922096ae9
--- /dev/null
+++ b/src/net45/WampSharp/WAMP2/V2/Api/Rx/IWampEventValueTupleConverter.cs
@@ -0,0 +1,16 @@
+using System.Collections.Generic;
+using WampSharp.Core.Serialization;
+
+namespace WampSharp.V2
+{
+ public interface IWampEventValueTupleConverter
+ {
+ TTuple ToTuple(IWampSerializedEvent @event);
+
+ TTuple ToTuple