Skip to content

Commit 961cd23

Browse files
gedemgedem
authored andcommitted
ClientWebSocket state added
1 parent bf43df3 commit 961cd23

File tree

4 files changed

+35
-1
lines changed

4 files changed

+35
-1
lines changed

src/NetCoreStack.WebSockets.ProxyClient/ClientWebSocketConnector.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ internal class ClientWebSocketConnector : IWebSocketConnector
1919
private readonly ILoggerFactory _loggerFactory;
2020
private readonly InvocatorRegistry _invocatorRegistry;
2121

22+
public WebSocketState WebSocketState
23+
{
24+
get
25+
{
26+
return _webSocket.State;
27+
}
28+
}
29+
2230
public ProxyOptions Options { get; }
2331

2432
public ClientWebSocketConnector(IOptions<ProxyOptions> options,

src/NetCoreStack.WebSockets.ProxyClient/IWebSocketConnector.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
using System.Threading.Tasks;
1+
using System.Net.WebSockets;
2+
using System.Threading.Tasks;
23

34
namespace NetCoreStack.WebSockets.ProxyClient
45
{
56
public interface IWebSocketConnector
67
{
8+
WebSocketState WebSocketState { get; }
79
ProxyOptions Options { get; }
810
Task ConnectAsync();
911
Task SendAsync(WebSocketMessageContext context);
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
6+
7+
// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
8+
9+
namespace WebClientTestApp.Controllers
10+
{
11+
public class ProcessController : Controller
12+
{
13+
// GET: /<controller>/
14+
public IActionResult Index()
15+
{
16+
return View();
17+
}
18+
}
19+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@*
2+
For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
3+
*@
4+
@{
5+
}

0 commit comments

Comments
 (0)