77
88namespace WampSharp . SignalR
99{
10+ /// <summary>
11+ /// Represents a <see cref="IWampConnection{TMessage}"/> implemented using SignalR.
12+ /// </summary>
13+ /// <typeparam name="TMessage"></typeparam>
1014 public class SignalRTextConnection < TMessage > : IControlledWampConnection < TMessage >
1115 {
1216 private readonly IWampTextBinding < TMessage > mBinding ;
1317 private readonly Connection mConnection ;
1418 private readonly IClientTransport mTransport ;
1519
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>
1626 public SignalRTextConnection ( string uri , IWampTextBinding < TMessage > binding , IClientTransport transport )
1727 {
1828 mBinding = binding ;
@@ -24,18 +34,18 @@ public SignalRTextConnection(string uri, IWampTextBinding<TMessage> binding, ICl
2434 mConnection . Received += OnReceived ;
2535 }
2636
27- public void OnReceived ( string text )
37+ private void OnReceived ( string text )
2838 {
2939 WampMessage < TMessage > message = mBinding . Parse ( text ) ;
3040 this . RaiseMessageArrived ( new WampMessageArrivedEventArgs < TMessage > ( message ) ) ;
3141 }
3242
33- public void OnError ( Exception exception )
43+ private void OnError ( Exception exception )
3444 {
3545 this . RaiseConnectionError ( new WampConnectionErrorEventArgs ( exception ) ) ;
3646 }
3747
38- public void OnClosed ( )
48+ private void OnClosed ( )
3949 {
4050 this . RaiseConnectionClosed ( ) ;
4151 }
@@ -85,9 +95,24 @@ protected virtual void RaiseConnectionError(WampConnectionErrorEventArgs e)
8595 if ( handler != null ) handler ( this , e ) ;
8696 }
8797
98+ /// <summary>
99+ /// Occurs when this connection opens.
100+ /// </summary>
88101 public event EventHandler ConnectionOpen ;
102+
103+ /// <summary>
104+ /// Occurs when a message arrives.
105+ /// </summary>
89106 public event EventHandler < WampMessageArrivedEventArgs < TMessage > > MessageArrived ;
107+
108+ /// <summary>
109+ /// Occurs when this connection closes.
110+ /// </summary>
90111 public event EventHandler ConnectionClosed ;
112+
113+ /// <summary>
114+ /// Occurs when this connection occurs an error.
115+ /// </summary>
91116 public event EventHandler < WampConnectionErrorEventArgs > ConnectionError ;
92117 }
93118}
0 commit comments