Skip to content

Commit

Permalink
Adding some constructors and some methods to IWampHost interface and …
Browse files Browse the repository at this point in the history
…implementations
  • Loading branch information
Elad Zelingher committed Sep 9, 2014
1 parent d3a678e commit 416c612
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/WampSharp.Default/DefaultWampCraHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ namespace WampSharp
{
public class DefaultWampCraHost : DefaultWampCraHost<JToken>
{
public DefaultWampCraHost(string location, IWampCraServerBuilder<JToken> serverBuilder) :
base(location, serverBuilder, new JTokenMessageParser(), new JsonFormatter())
{
}

public DefaultWampCraHost(string location, WampCraAuthenticaticatorBuilder<JToken> craAuthenticaticatorBuilder) :
base(location, new JTokenMessageParser(), new JsonFormatter(), craAuthenticaticatorBuilder)
{
Expand All @@ -17,6 +22,15 @@ public DefaultWampCraHost(string location, WampCraAuthenticaticatorBuilder<JToke

public class DefaultWampCraHost<TMessage> : WampCraHost<TMessage>
{
public DefaultWampCraHost(string location,
IWampCraServerBuilder<TMessage> serverBuilder,
IWampMessageParser<TMessage> parser,
IWampFormatter<TMessage> formatter) :
base(serverBuilder,
new FleckWampConnectionListener<TMessage>(location, parser), formatter)
{
}

public DefaultWampCraHost(string location,
IWampMessageParser<TMessage> parser,
IWampFormatter<TMessage> formatter,
Expand All @@ -35,4 +49,4 @@ public DefaultWampCraHost(IWampCraServerBuilder<TMessage> serverBuilder, IWampCo
{
}
}
}
}
15 changes: 15 additions & 0 deletions src/WampSharp.Default/DefaultWampHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,25 @@ public DefaultWampHost(string location) :
base(location, new JTokenMessageParser(), new JsonFormatter())
{
}

public DefaultWampHost(string location, IWampServerBuilder<JToken> serverBuilder) :
base(location, serverBuilder, new JTokenMessageParser(), new JsonFormatter())
{
}
}

public class DefaultWampHost<TMessage> : WampHost<TMessage>
{
public DefaultWampHost(string location,
IWampServerBuilder<TMessage> serverBuilder,
IWampMessageParser<TMessage> parser,
IWampFormatter<TMessage> formatter) :
base(serverBuilder,
new FleckWampConnectionListener<TMessage>(location, parser),
formatter)
{
}

public DefaultWampHost(string location,
IWampMessageParser<TMessage> parser,
IWampFormatter<TMessage> formatter) :
Expand Down
6 changes: 6 additions & 0 deletions src/WampSharp/Api/Server/IWampHost.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using WampSharp.Core.Listener.V1;
using WampSharp.PubSub.Server;
using WampSharp.Rpc.Server;

namespace WampSharp
{
Expand All @@ -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<WampSessionEventArgs> SessionCreated;
event EventHandler<WampSessionEventArgs> SessionClosed;
}
}

0 comments on commit 416c612

Please sign in to comment.