Skip to content

Commit 416c612

Browse files
author
Elad Zelingher
committed
Adding some constructors and some methods to IWampHost interface and implementations
1 parent d3a678e commit 416c612

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

src/WampSharp.Default/DefaultWampCraHost.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ namespace WampSharp
99
{
1010
public class DefaultWampCraHost : DefaultWampCraHost<JToken>
1111
{
12+
public DefaultWampCraHost(string location, IWampCraServerBuilder<JToken> serverBuilder) :
13+
base(location, serverBuilder, new JTokenMessageParser(), new JsonFormatter())
14+
{
15+
}
16+
1217
public DefaultWampCraHost(string location, WampCraAuthenticaticatorBuilder<JToken> craAuthenticaticatorBuilder) :
1318
base(location, new JTokenMessageParser(), new JsonFormatter(), craAuthenticaticatorBuilder)
1419
{
@@ -17,6 +22,15 @@ public DefaultWampCraHost(string location, WampCraAuthenticaticatorBuilder<JToke
1722

1823
public class DefaultWampCraHost<TMessage> : WampCraHost<TMessage>
1924
{
25+
public DefaultWampCraHost(string location,
26+
IWampCraServerBuilder<TMessage> serverBuilder,
27+
IWampMessageParser<TMessage> parser,
28+
IWampFormatter<TMessage> formatter) :
29+
base(serverBuilder,
30+
new FleckWampConnectionListener<TMessage>(location, parser), formatter)
31+
{
32+
}
33+
2034
public DefaultWampCraHost(string location,
2135
IWampMessageParser<TMessage> parser,
2236
IWampFormatter<TMessage> formatter,
@@ -35,4 +49,4 @@ public DefaultWampCraHost(IWampCraServerBuilder<TMessage> serverBuilder, IWampCo
3549
{
3650
}
3751
}
38-
}
52+
}

src/WampSharp.Default/DefaultWampHost.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,25 @@ public DefaultWampHost(string location) :
1212
base(location, new JTokenMessageParser(), new JsonFormatter())
1313
{
1414
}
15+
16+
public DefaultWampHost(string location, IWampServerBuilder<JToken> serverBuilder) :
17+
base(location, serverBuilder, new JTokenMessageParser(), new JsonFormatter())
18+
{
19+
}
1520
}
1621

1722
public class DefaultWampHost<TMessage> : WampHost<TMessage>
1823
{
24+
public DefaultWampHost(string location,
25+
IWampServerBuilder<TMessage> serverBuilder,
26+
IWampMessageParser<TMessage> parser,
27+
IWampFormatter<TMessage> formatter) :
28+
base(serverBuilder,
29+
new FleckWampConnectionListener<TMessage>(location, parser),
30+
formatter)
31+
{
32+
}
33+
1934
public DefaultWampHost(string location,
2035
IWampMessageParser<TMessage> parser,
2136
IWampFormatter<TMessage> formatter) :

src/WampSharp/Api/Server/IWampHost.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System;
2+
using WampSharp.Core.Listener.V1;
23
using WampSharp.PubSub.Server;
4+
using WampSharp.Rpc.Server;
35

46
namespace WampSharp
57
{
@@ -9,5 +11,9 @@ public interface IWampHost : IDisposable
911
void HostService(object instance, string baseUri = null);
1012

1113
IWampTopicContainer TopicContainer { get; }
14+
void Register(IWampRpcMetadata rpcMetadata);
15+
void Unregister(IWampRpcMethod method);
16+
event EventHandler<WampSessionEventArgs> SessionCreated;
17+
event EventHandler<WampSessionEventArgs> SessionClosed;
1218
}
1319
}

0 commit comments

Comments
 (0)