17
17
namespace Microsoft . PowerShell . EditorServices . Channel . WebSocket
18
18
{
19
19
/// <summary>
20
- /// Implementation of <see cref="ChannelBase"/> that implements the streams necessary for
21
- /// communicating via OWIN WebSockets.
20
+ /// Implementation of <see cref="ChannelBase"/> that implements the streams necessary for
21
+ /// communicating via OWIN WebSockets.
22
22
/// </summary>
23
23
public class WebSocketServerChannel : ChannelBase
24
24
{
@@ -42,22 +42,22 @@ protected override void Initialize(IMessageSerializer messageSerializer)
42
42
43
43
this . MessageWriter =
44
44
new MessageWriter (
45
- new WebSocketStream ( socketConnection ) ,
45
+ new WebSocketStream ( socketConnection ) ,
46
46
messageSerializer ) ;
47
47
}
48
48
49
49
/// <summary>
50
- /// Dispatches data received during calls to OnMessageReceived in the <see cref="WebSocketConnection"/> class.
50
+ /// Dispatches data received during calls to OnMessageReceivedAsync in the <see cref="WebSocketConnection"/> class.
51
51
/// </summary>
52
52
/// <remarks>
53
- /// This method calls an overriden version of the <see cref="MessageDispatcher"/> that dispatches messages on
54
- /// demand rather than running on a background thread.
53
+ /// This method calls an overriden version of the <see cref="MessageDispatcher"/> that dispatches messages on
54
+ /// demand rather than running on a background thread.
55
55
/// </remarks>
56
56
/// <param name="message"></param>
57
57
/// <returns></returns>
58
- public async Task Dispatch ( ArraySegment < byte > message )
58
+ public async Task DispatchAsync ( ArraySegment < byte > message )
59
59
{
60
- //Clear our stream
60
+ //Clear our stream
61
61
inStream . SetLength ( 0 ) ;
62
62
63
63
//Write data and dispatch to handlers
@@ -70,19 +70,19 @@ protected override void Shutdown()
70
70
this . socketConnection . Close ( WebSocketCloseStatus . NormalClosure , "Server shutting down" ) ;
71
71
}
72
72
73
- public override Task WaitForConnection ( )
73
+ public override Task WaitForConnectionAsync ( )
74
74
{
75
75
// TODO: Need to update behavior here
76
76
return Task . FromResult ( true ) ;
77
77
}
78
78
}
79
79
80
80
/// <summary>
81
- /// Overriden <see cref="MemoryStream"/> that sends data through a <see cref="WebSocketConnection"/> during the FlushAsync call.
81
+ /// Overriden <see cref="MemoryStream"/> that sends data through a <see cref="WebSocketConnection"/> during the FlushAsync call.
82
82
/// </summary>
83
83
/// <remarks>
84
84
/// FlushAsync will send data via the SendBinary method of the <see cref="WebSocketConnection"/> class. The memory streams length will
85
- /// then be set to 0 to reset the stream for additional data to be written.
85
+ /// then be set to 0 to reset the stream for additional data to be written.
86
86
/// </remarks>
87
87
internal class WebSocketStream : MemoryStream
88
88
{
@@ -106,7 +106,7 @@ public override async Task FlushAsync(CancellationToken cancellationToken)
106
106
/// </summary>
107
107
public abstract class EditorServiceWebSocketConnection : WebSocketConnection
108
108
{
109
- protected EditorServiceWebSocketConnection ( )
109
+ protected EditorServiceWebSocketConnection ( )
110
110
{
111
111
Channel = new WebSocketServerChannel ( this ) ;
112
112
}
@@ -120,9 +120,9 @@ public override void OnOpen()
120
120
Server . Start ( ) ;
121
121
}
122
122
123
- public override async Task OnMessageReceived ( ArraySegment < byte > message , WebSocketMessageType type )
123
+ public override async Task OnMessageReceivedAsync ( ArraySegment < byte > message , WebSocketMessageType type )
124
124
{
125
- await Channel . Dispatch ( message ) ;
125
+ await Channel . DispatchAsync ( message ) ;
126
126
}
127
127
128
128
public override Task OnCloseAsync ( WebSocketCloseStatus ? closeStatus , string closeStatusDescription )
0 commit comments