-
Notifications
You must be signed in to change notification settings - Fork 8
/
ParamsTcpServerAuth.cs
19 lines (16 loc) · 1.03 KB
/
ParamsTcpServerAuth.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using System;
namespace Tcp.NET.Server.Models
{
public class ParamsTcpServerAuth : ParamsTcpServer, IParamsTcpServerAuth
{
public string ConnectionUnauthorizedString { get; protected set; }
public ParamsTcpServerAuth(int port, string endOfLineCharacters, string connectionSuccessString = null, string connectionUnauthorizedString = null, bool onlyEmitBytes = false, int pingIntervalSec = 120, string pingCharacters = "ping", string pongCharacters = "pong", bool sendDisconnectBytes = true, byte[] disconnectBytes = null) : base(port, endOfLineCharacters, connectionSuccessString, onlyEmitBytes, pingIntervalSec, pingCharacters, pongCharacters, sendDisconnectBytes, disconnectBytes)
{
if (onlyEmitBytes && !string.IsNullOrWhiteSpace(connectionUnauthorizedString))
{
throw new ArgumentException("onlyEmitBytes can not be true is a connectionUnauthorizedString is specified");
}
ConnectionUnauthorizedString = connectionUnauthorizedString;
}
}
}