From 416c612112c36c19fc02764cf2476b8a92af5085 Mon Sep 17 00:00:00 2001 From: Elad Zelingher Date: Tue, 9 Sep 2014 22:39:42 +0300 Subject: [PATCH] Adding some constructors and some methods to IWampHost interface and implementations --- src/WampSharp.Default/DefaultWampCraHost.cs | 16 +++++++++++++++- src/WampSharp.Default/DefaultWampHost.cs | 15 +++++++++++++++ src/WampSharp/Api/Server/IWampHost.cs | 6 ++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/WampSharp.Default/DefaultWampCraHost.cs b/src/WampSharp.Default/DefaultWampCraHost.cs index f629bfa9f..c81037e4d 100644 --- a/src/WampSharp.Default/DefaultWampCraHost.cs +++ b/src/WampSharp.Default/DefaultWampCraHost.cs @@ -9,6 +9,11 @@ namespace WampSharp { public class DefaultWampCraHost : DefaultWampCraHost { + public DefaultWampCraHost(string location, IWampCraServerBuilder serverBuilder) : + base(location, serverBuilder, new JTokenMessageParser(), new JsonFormatter()) + { + } + public DefaultWampCraHost(string location, WampCraAuthenticaticatorBuilder craAuthenticaticatorBuilder) : base(location, new JTokenMessageParser(), new JsonFormatter(), craAuthenticaticatorBuilder) { @@ -17,6 +22,15 @@ public DefaultWampCraHost(string location, WampCraAuthenticaticatorBuilder : WampCraHost { + public DefaultWampCraHost(string location, + IWampCraServerBuilder serverBuilder, + IWampMessageParser parser, + IWampFormatter formatter) : + base(serverBuilder, + new FleckWampConnectionListener(location, parser), formatter) + { + } + public DefaultWampCraHost(string location, IWampMessageParser parser, IWampFormatter formatter, @@ -35,4 +49,4 @@ public DefaultWampCraHost(IWampCraServerBuilder serverBuilder, IWampCo { } } -} +} \ No newline at end of file diff --git a/src/WampSharp.Default/DefaultWampHost.cs b/src/WampSharp.Default/DefaultWampHost.cs index 18adfb9d9..76f6e8e47 100644 --- a/src/WampSharp.Default/DefaultWampHost.cs +++ b/src/WampSharp.Default/DefaultWampHost.cs @@ -12,10 +12,25 @@ public DefaultWampHost(string location) : base(location, new JTokenMessageParser(), new JsonFormatter()) { } + + public DefaultWampHost(string location, IWampServerBuilder serverBuilder) : + base(location, serverBuilder, new JTokenMessageParser(), new JsonFormatter()) + { + } } public class DefaultWampHost : WampHost { + public DefaultWampHost(string location, + IWampServerBuilder serverBuilder, + IWampMessageParser parser, + IWampFormatter formatter) : + base(serverBuilder, + new FleckWampConnectionListener(location, parser), + formatter) + { + } + public DefaultWampHost(string location, IWampMessageParser parser, IWampFormatter formatter) : diff --git a/src/WampSharp/Api/Server/IWampHost.cs b/src/WampSharp/Api/Server/IWampHost.cs index 020bd79e6..5850b7ff3 100644 --- a/src/WampSharp/Api/Server/IWampHost.cs +++ b/src/WampSharp/Api/Server/IWampHost.cs @@ -1,5 +1,7 @@ using System; +using WampSharp.Core.Listener.V1; using WampSharp.PubSub.Server; +using WampSharp.Rpc.Server; namespace WampSharp { @@ -9,5 +11,9 @@ public interface IWampHost : IDisposable void HostService(object instance, string baseUri = null); IWampTopicContainer TopicContainer { get; } + void Register(IWampRpcMetadata rpcMetadata); + void Unregister(IWampRpcMethod method); + event EventHandler SessionCreated; + event EventHandler SessionClosed; } } \ No newline at end of file