Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into NET5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LiveOrDevTrying committed Mar 6, 2024
2 parents 4f1fca4 + 2d425d5 commit a9673c3
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Tcp.NET.Client/Handlers/TcpClientHandler.cs
Expand Up @@ -10,10 +10,10 @@ public class TcpClientHandler :
TcpConnectionClientEventArgs,
TcpMessageClientEventArgs,
TcpErrorClientEventArgs,
ParamsTcpClient,
IParamsTcpClient,
ConnectionTcp>
{
public TcpClientHandler(ParamsTcpClient parameters) : base(parameters)
public TcpClientHandler(IParamsTcpClient parameters) : base(parameters)
{
}

Expand Down
2 changes: 1 addition & 1 deletion Tcp.NET.Client/Handlers/TcpClientHandlerBase.cs
Expand Up @@ -20,7 +20,7 @@ public abstract class TcpClientHandlerBase<T, U, V, W, Y> :
where T : TcpConnectionEventArgs<Y>
where U : TcpMessageEventArgs<Y>
where V : TcpErrorEventArgs<Y>
where W : ParamsTcpClient
where W : IParamsTcpClient
where Y : ConnectionTcp
{
public TcpClientHandlerBase(W parameters) : base(parameters)
Expand Down
2 changes: 1 addition & 1 deletion Tcp.NET.Client/Models/ParamsTcpClientBytes.cs
Expand Up @@ -19,7 +19,7 @@ public class ParamsTcpClientBytes : IParamsTcpClient
public bool UseDisconnectBytes { get; protected set; }
public byte[] DisconnectBytes { get; protected set; }

public ParamsTcpClientBytes(string host, int port, byte[] endOfLineBytes, byte[] token = null, bool isSSL = true, bool onlyEmitBytes = true, bool usePingPong = true, byte[] pingBytes = null, byte[] pongBytes = null, bool useDisconnectBytes = true, byte[] disconnectBytes = null)
public ParamsTcpClientBytes(string host, int port, byte[] endOfLineBytes, byte[] token = null, bool isSSL = true, bool onlyEmitBytes = false, bool usePingPong = true, byte[] pingBytes = null, byte[] pongBytes = null, bool useDisconnectBytes = true, byte[] disconnectBytes = null)
{
if (string.IsNullOrWhiteSpace(host))
{
Expand Down
4 changes: 2 additions & 2 deletions Tcp.NET.Client/TcpNETClient.cs
Expand Up @@ -11,12 +11,12 @@ public class TcpNETClient :
TcpConnectionClientEventArgs,
TcpMessageClientEventArgs,
TcpErrorClientEventArgs,
ParamsTcpClient,
IParamsTcpClient,
TcpClientHandler,
ConnectionTcp>,
ITcpNETClient
{
public TcpNETClient(ParamsTcpClient parameters) : base(parameters)
public TcpNETClient(IParamsTcpClient parameters) : base(parameters)
{
}

Expand Down
6 changes: 3 additions & 3 deletions Tcp.NET.Server/Handlers/TcpHandlerServer.cs
Expand Up @@ -11,13 +11,13 @@ public class TcpHandlerServer :
TcpConnectionServerEventArgs,
TcpMessageServerEventArgs,
TcpErrorServerEventArgs,
ParamsTcpServer,
IParamsTcpServer,
ConnectionTcpServer>
{
public TcpHandlerServer(ParamsTcpServer parameters) : base(parameters)
public TcpHandlerServer(IParamsTcpServer parameters) : base(parameters)
{
}
public TcpHandlerServer(ParamsTcpServer parameters, byte[] certificate, string certificatePassword) : base(parameters, certificate, certificatePassword)
public TcpHandlerServer(IParamsTcpServer parameters, byte[] certificate, string certificatePassword) : base(parameters, certificate, certificatePassword)
{
}

Expand Down
6 changes: 3 additions & 3 deletions Tcp.NET.Server/Handlers/TcpHandlerServerAuth.cs
Expand Up @@ -13,15 +13,15 @@ public class TcpHandlerServerAuth<T> :
TcpConnectionServerAuthEventArgs<T>,
TcpMessageServerAuthEventArgs<T>,
TcpErrorServerAuthEventArgs<T>,
ParamsTcpServerAuth,
IParamsTcpServerAuth,
TcpAuthorizeEventArgs<T>,
IdentityTcpServer<T>,
T>
{
public TcpHandlerServerAuth(ParamsTcpServerAuth parameters) : base(parameters)
public TcpHandlerServerAuth(IParamsTcpServerAuth parameters) : base(parameters)
{
}
public TcpHandlerServerAuth(ParamsTcpServerAuth parameters, byte[] certificate, string certificatePassword) : base(parameters, certificate, certificatePassword)
public TcpHandlerServerAuth(IParamsTcpServerAuth parameters, byte[] certificate, string certificatePassword) : base(parameters, certificate, certificatePassword)
{
}

Expand Down
2 changes: 1 addition & 1 deletion Tcp.NET.Server/Handlers/TcpHandlerServerAuthBase.cs
Expand Up @@ -17,7 +17,7 @@ public abstract class TcpHandlerServerAuthBase<T, U, V, W, X, Z, A> :
where T : TcpConnectionServerAuthBaseEventArgs<Z, A>
where U : TcpMessageServerAuthBaseEventArgs<Z, A>
where V : TcpErrorServerAuthBaseEventArgs<Z, A>
where W : ParamsTcpServerAuth
where W : IParamsTcpServerAuth
where X : TcpAuthorizeBaseEventArgs<Z, A>
where Z : IdentityTcpServer<A>
{
Expand Down
2 changes: 1 addition & 1 deletion Tcp.NET.Server/Handlers/TcpHandlerServerBase.cs
Expand Up @@ -23,7 +23,7 @@ public abstract class TcpHandlerServerBase<T, U, V, W, Z> :
where T : TcpConnectionServerBaseEventArgs<Z>
where U : TcpMessageServerBaseEventArgs<Z>
where V : TcpErrorServerBaseEventArgs<Z>
where W : ParamsTcpServer
where W : IParamsTcpServer
where Z : ConnectionTcpServer
{
protected TcpListener _server;
Expand Down
7 changes: 7 additions & 0 deletions Tcp.NET.Server/Models/IParamsTcpServerAuth.cs
@@ -0,0 +1,7 @@
namespace Tcp.NET.Server.Models
{
public interface IParamsTcpServerAuth : IParamsTcpServer
{
string ConnectionUnauthorizedString { get; }
}
}
2 changes: 1 addition & 1 deletion Tcp.NET.Server/Models/ParamsTcpServerAuth.cs
Expand Up @@ -2,7 +2,7 @@

namespace Tcp.NET.Server.Models
{
public class ParamsTcpServerAuth : ParamsTcpServer
public class ParamsTcpServerAuth : ParamsTcpServer, IParamsTcpServerAuth
{
public string ConnectionUnauthorizedString { get; protected set; }

Expand Down
4 changes: 2 additions & 2 deletions Tcp.NET.Server/Models/ParamsTcpServerAuthBytes.cs
Expand Up @@ -2,15 +2,15 @@

namespace Tcp.NET.Server.Models
{
public class ParamsTcpServerAuthBytes : ParamsTcpServerBytes
public class ParamsTcpServerAuthBytes : ParamsTcpServerBytes, IParamsTcpServerAuth
{
public string ConnectionUnauthorizedString { get; protected set; }

public ParamsTcpServerAuthBytes(int port, byte[] endOfLineBytes, string connectionSuccessString = null, string connectionUnauthorizedString = null, bool onlyEmitBytes = false, int pingIntervalSec = 120, byte[] pingBytes = null, byte[] pongBytes = null, bool sendDisconnectBytes = true, byte[] disconnectBytes = null) : base(port, endOfLineBytes, connectionSuccessString, onlyEmitBytes, pingIntervalSec, pingBytes, pongBytes, sendDisconnectBytes, disconnectBytes)
{
if (onlyEmitBytes && !string.IsNullOrWhiteSpace(connectionUnauthorizedString))
{
throw new ArgumentException("onlyEmitBytes can not be true is a connectionUnauthorizedString is specified");
throw new ArgumentException("onlyEmitBytes can not be true if a connectionUnauthorizedString is specified");
}

ConnectionUnauthorizedString = connectionUnauthorizedString;
Expand Down
6 changes: 3 additions & 3 deletions Tcp.NET.Server/TcpNETServer.cs
Expand Up @@ -10,17 +10,17 @@ public class TcpNETServer :
TcpConnectionServerEventArgs,
TcpMessageServerEventArgs,
TcpErrorServerEventArgs,
ParamsTcpServer,
IParamsTcpServer,
TcpHandlerServer,
TcpConnectionManager,
ConnectionTcpServer>,
ITcpNETServer
{
public TcpNETServer(ParamsTcpServer parameters) : base(parameters)
public TcpNETServer(IParamsTcpServer parameters) : base(parameters)
{
}

public TcpNETServer(ParamsTcpServer parameters,
public TcpNETServer(IParamsTcpServer parameters,
byte[] certificate,
string certificatePassword) : base(parameters, certificate, certificatePassword)
{
Expand Down
6 changes: 3 additions & 3 deletions Tcp.NET.Server/TcpNETServerAuth.cs
Expand Up @@ -13,19 +13,19 @@ public class TcpNETServerAuth<T> :
TcpConnectionServerAuthEventArgs<T>,
TcpMessageServerAuthEventArgs<T>,
TcpErrorServerAuthEventArgs<T>,
ParamsTcpServerAuth,
IParamsTcpServerAuth,
TcpHandlerServerAuth<T>,
TcpConnectionManagerAuth<T>,
IdentityTcpServer<T>,
T,
TcpAuthorizeEventArgs<T>>,
ITcpNETServerAuth<T>
{
public TcpNETServerAuth(ParamsTcpServerAuth parameters,
public TcpNETServerAuth(IParamsTcpServerAuth parameters,
IUserService<T> userService) : base(parameters, userService)
{
}
public TcpNETServerAuth(ParamsTcpServerAuth parameters,
public TcpNETServerAuth(IParamsTcpServerAuth parameters,
IUserService<T> userService,
byte[] certificate,
string certificatePassword) : base(parameters, userService, certificate, certificatePassword)
Expand Down
2 changes: 1 addition & 1 deletion Tcp.NET.Server/TcpNETServerAuthBase.cs
Expand Up @@ -15,7 +15,7 @@ public abstract class TcpNETServerAuthBase<T, U, V, W, X, Y, Z, A, B> :
where T : TcpConnectionServerAuthBaseEventArgs<Z, A>
where U : TcpMessageServerAuthBaseEventArgs<Z, A>
where V : TcpErrorServerAuthBaseEventArgs<Z, A>
where W : ParamsTcpServerAuth
where W : IParamsTcpServerAuth
where X : TcpHandlerServerAuthBase<T, U, V, W, B, Z, A>
where Y : ConnectionManagerAuth<Z, A>
where Z : IdentityTcpServer<A>
Expand Down
2 changes: 1 addition & 1 deletion Tcp.NET.Server/TcpNETServerBase.cs
Expand Up @@ -19,7 +19,7 @@ public abstract class TcpNETServerBase<T, U, V, W, X, Y, Z> :
where T : TcpConnectionServerBaseEventArgs<Z>
where U : TcpMessageServerBaseEventArgs<Z>
where V : TcpErrorServerBaseEventArgs<Z>
where W : ParamsTcpServer
where W : IParamsTcpServer
where X : TcpHandlerServerBase<T, U, V, W, Z>
where Y : ConnectionManager<Z>
where Z : ConnectionTcpServer
Expand Down

0 comments on commit a9673c3

Please sign in to comment.