Skip to content

Commit 32e7c69

Browse files
committed
chore: add missing constructor from NetCoreServer (#43)
1 parent 13a38fa commit 32e7c69

3 files changed

Lines changed: 95 additions & 9 deletions

File tree

documentation/docs/reference/simplewserver.md

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,61 @@ The `SimplewServer` is the main class to instanciate and manipulate the web serv
44

55
## Constructors
66

7+
### HTTP
8+
9+
```csharp
10+
/// <summary>
11+
/// Initialize server with a given IP address and port number
12+
/// </summary>
13+
/// <param name="address"></param>
14+
/// <param name="port"></param>
15+
public SimpleWServer(IPAddress address, int port)
16+
```
17+
718
```csharp
8-
SimpleWServer(IPAddress address, int port)
19+
/// <summary>
20+
/// Initialize WebSocket server with a given DNS endpoint
21+
/// </summary>
22+
/// <param name="endpoint">DNS endpoint</param>
23+
public SimpleWServer(DnsEndPoint endpoint)
24+
```
25+
26+
```csharp
27+
/// <summary>
28+
/// Initialize WebSocket server with a given IP endpoint
29+
/// </summary>
30+
/// <param name="endpoint">IP endpoint</param>
31+
public SimpleWServer(IPEndPoint endpoint)
932
```
1033

11-
The constructor takes an `IPAddress` and a `port` number.
12-
You can use `IPAddress.Any` to match all IP addresses of the machine.
34+
### HTTPS
35+
36+
```csharp
37+
/// <summary>
38+
/// Initialize WebSocket server with a given IP address and port number
39+
/// </summary>
40+
/// <param name="context">SSL context</param>
41+
/// <param name="address">IP address</param>
42+
/// <param name="port">Port number</param>
43+
public SimpleWSServer(SslContext context, IPAddress address, int port)
44+
```
1345

46+
```csharp
47+
/// <summary>
48+
/// Initialize WebSocket server with a given DNS endpoint
49+
/// </summary>
50+
/// <param name="context">SSL context</param>
51+
/// <param name="endpoint">DNS endpoint</param>
52+
public SimpleWSServer(SslContext context, DnsEndPoint endpoint)
53+
```
1454

1555
```csharp
16-
SimpleWSServer(SslContext context, IPAddress address, int port)
56+
/// <summary>
57+
/// Initialize WebSocket server with a given IP endpoint
58+
/// </summary>
59+
/// <param name="context">SSL context</param>
60+
/// <param name="endpoint">IP endpoint</param>
61+
public SimpleWSServer(SslContext context, IPEndPoint endpoint)
1762
```
1863

1964
The class `SimpleWSServer` is exactly the same as `SimplewServer` except it takes a `SslContext` as primary argument.

src/SimpleW/SimpleW/SimpleWSServer.cs

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,35 @@ public class SimpleWSServer : WssServer, ISimpleWServer {
2626
#region netcoreserver
2727

2828
/// <summary>
29-
/// Herited Mandatory Constructor
29+
/// Initialize server with a given IP address and port number
3030
/// </summary>
31-
/// <param name="context"></param>
32-
/// <param name="address"></param>
33-
/// <param name="port"></param>
31+
/// <param name="context">SSL context</param>
32+
/// <param name="address">IP address</param>
33+
/// <param name="port">Port number</param>
3434
public SimpleWSServer(SslContext context, IPAddress address, int port) : base(context, address, port) { }
3535

36+
/// <summary>
37+
/// Initialize server with a given IP address and port number
38+
/// </summary>
39+
/// <param name="context">SSL context</param>
40+
/// <param name="address">IP address</param>
41+
/// <param name="port">Port number</param>
42+
public SimpleWSServer(SslContext context, string address, int port) : base(context, address, port) { }
43+
44+
/// <summary>
45+
/// Initialize server with a given DNS endpoint
46+
/// </summary>
47+
/// <param name="context">SSL context</param>
48+
/// <param name="endpoint">DNS endpoint</param>
49+
public SimpleWSServer(SslContext context, DnsEndPoint endpoint) : base(context, endpoint) { }
50+
51+
/// <summary>
52+
/// Initialize server with a given IP endpoint
53+
/// </summary>
54+
/// <param name="context">SSL context</param>
55+
/// <param name="endpoint">IP endpoint</param>
56+
public SimpleWSServer(SslContext context, IPEndPoint endpoint) : base(context, endpoint) { }
57+
3658
/// <summary>
3759
/// Herited mandatory factory https/wss session builder
3860
/// </summary>

src/SimpleW/SimpleW/SimpleWServer.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,31 @@ public class SimpleWServer : WsServer, ISimpleWServer {
2626
#region netcoreserver
2727

2828
/// <summary>
29-
/// Herited Mandatory Constructor
29+
/// Initialize server with a given IP address and port number
3030
/// </summary>
3131
/// <param name="address"></param>
3232
/// <param name="port"></param>
3333
public SimpleWServer(IPAddress address, int port) : base(address, port) { }
3434

35+
/// <summary>
36+
/// Initialize server with a given IP address and port number
37+
/// </summary>
38+
/// <param name="address"></param>
39+
/// <param name="port"></param>
40+
public SimpleWServer(string address, int port) : base(address, port) { }
41+
42+
/// <summary>
43+
/// Initialize server with a given DNS endpoint
44+
/// </summary>
45+
/// <param name="endpoint">DNS endpoint</param>
46+
public SimpleWServer(DnsEndPoint endpoint) : base(endpoint) { }
47+
48+
/// <summary>
49+
/// Initialize server with a given IP endpoint
50+
/// </summary>
51+
/// <param name="endpoint">IP endpoint</param>
52+
public SimpleWServer(IPEndPoint endpoint) : base(endpoint) { }
53+
3554
/// <summary>
3655
/// Herited mandatory factory http/ws session builder
3756
/// </summary>

0 commit comments

Comments
 (0)