7
7
8
8
namespace WampSharp . SignalR
9
9
{
10
+ /// <summary>
11
+ /// Represents a <see cref="IWampConnection{TMessage}"/> implemented using SignalR.
12
+ /// </summary>
13
+ /// <typeparam name="TMessage"></typeparam>
10
14
public class SignalRTextConnection < TMessage > : IControlledWampConnection < TMessage >
11
15
{
12
16
private readonly IWampTextBinding < TMessage > mBinding ;
13
17
private readonly Connection mConnection ;
14
18
private readonly IClientTransport mTransport ;
15
19
20
+ /// <summary>
21
+ /// Creates a new instance of <see cref="SignalRTextConnection{TMessage}"/>.
22
+ /// </summary>
23
+ /// <param name="uri">The uri of the server to connect to.</param>
24
+ /// <param name="binding">The binding to use.</param>
25
+ /// <param name="transport">The <see cref="IClientTransport"/> to use.</param>
16
26
public SignalRTextConnection ( string uri , IWampTextBinding < TMessage > binding , IClientTransport transport )
17
27
{
18
28
mBinding = binding ;
@@ -24,18 +34,18 @@ public SignalRTextConnection(string uri, IWampTextBinding<TMessage> binding, ICl
24
34
mConnection . Received += OnReceived ;
25
35
}
26
36
27
- public void OnReceived ( string text )
37
+ private void OnReceived ( string text )
28
38
{
29
39
WampMessage < TMessage > message = mBinding . Parse ( text ) ;
30
40
this . RaiseMessageArrived ( new WampMessageArrivedEventArgs < TMessage > ( message ) ) ;
31
41
}
32
42
33
- public void OnError ( Exception exception )
43
+ private void OnError ( Exception exception )
34
44
{
35
45
this . RaiseConnectionError ( new WampConnectionErrorEventArgs ( exception ) ) ;
36
46
}
37
47
38
- public void OnClosed ( )
48
+ private void OnClosed ( )
39
49
{
40
50
this . RaiseConnectionClosed ( ) ;
41
51
}
@@ -85,9 +95,24 @@ protected virtual void RaiseConnectionError(WampConnectionErrorEventArgs e)
85
95
if ( handler != null ) handler ( this , e ) ;
86
96
}
87
97
98
+ /// <summary>
99
+ /// Occurs when this connection opens.
100
+ /// </summary>
88
101
public event EventHandler ConnectionOpen ;
102
+
103
+ /// <summary>
104
+ /// Occurs when a message arrives.
105
+ /// </summary>
89
106
public event EventHandler < WampMessageArrivedEventArgs < TMessage > > MessageArrived ;
107
+
108
+ /// <summary>
109
+ /// Occurs when this connection closes.
110
+ /// </summary>
90
111
public event EventHandler ConnectionClosed ;
112
+
113
+ /// <summary>
114
+ /// Occurs when this connection occurs an error.
115
+ /// </summary>
91
116
public event EventHandler < WampConnectionErrorEventArgs > ConnectionError ;
92
117
}
93
118
}
0 commit comments