-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into NETCore3.0
# Conflicts: # Tcp.NET.Server/Handlers/TcpHandlerServerBaseTcp.cs
- Loading branch information
Showing
42 changed files
with
886 additions
and
844 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: Check Markdown links | ||
|
||
on: push | ||
|
||
jobs: | ||
markdown-link-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: gaurav-nelson/github-action-markdown-link-check@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,6 @@ public interface ITcpNETClient : | |
TcpErrorClientEventArgs, | ||
ConnectionTcp> | ||
{ | ||
bool IsRunning { get; } | ||
} | ||
} |
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using PHS.Networking.Models; | ||
|
||
namespace Tcp.NET.Client.Models | ||
{ | ||
public interface IParamsTcpClient : IParams | ||
{ | ||
byte[] DisconnectBytes { get; } | ||
byte[] EndOfLineBytes { get; } | ||
string Host { get; } | ||
bool IsSSL { get; } | ||
bool OnlyEmitBytes { get; } | ||
byte[] PingBytes { get; } | ||
byte[] PongBytes { get; } | ||
int Port { get; } | ||
byte[] Token { get; } | ||
bool UseDisconnectBytes { get; } | ||
bool UsePingPong { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using PHS.Networking.Utilities; | ||
using System; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Tcp.NET.Client.Models | ||
{ | ||
public class ParamsTcpClientBytes : IParamsTcpClient | ||
{ | ||
public string Host { get; protected set; } | ||
public int Port { get; protected set; } | ||
public byte[] EndOfLineBytes { get; protected set; } | ||
public bool UsePingPong { get; protected set; } | ||
public byte[] PingBytes { get; protected set; } | ||
public byte[] PongBytes { get; protected set; } | ||
public bool IsSSL { get; protected set; } | ||
public bool OnlyEmitBytes { get; protected set; } | ||
public byte[] Token { get; protected set; } | ||
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) | ||
{ | ||
if (string.IsNullOrWhiteSpace(host)) | ||
{ | ||
throw new ArgumentException("Host is not valid"); | ||
} | ||
|
||
if (port <= 0) | ||
{ | ||
throw new ArgumentException("Port is not valid"); | ||
} | ||
|
||
if (endOfLineBytes == null || endOfLineBytes.Length <= 0 || Statics.ByteArrayEquals(endOfLineBytes, Array.Empty<byte>())) | ||
{ | ||
throw new ArgumentException("End of Line Characters are not valid"); | ||
} | ||
|
||
if (token != null && token.Where(x => x != 0).ToArray().Length <= 0) | ||
{ | ||
throw new ArgumentException("Token is not valid"); | ||
} | ||
|
||
if (usePingPong && (pingBytes == null || pingBytes.Length <= 0 || Statics.ByteArrayEquals(pingBytes, Array.Empty<byte>()))) | ||
{ | ||
pingBytes = Encoding.UTF8.GetBytes("ping"); | ||
} | ||
|
||
if (usePingPong && (pongBytes == null || pongBytes.Length <= 0 || Statics.ByteArrayEquals(pongBytes, Array.Empty<byte>()))) | ||
{ | ||
pongBytes = Encoding.UTF8.GetBytes("pong"); | ||
} | ||
|
||
Host = host; | ||
Port = port; | ||
EndOfLineBytes = endOfLineBytes; | ||
UsePingPong = usePingPong; | ||
PingBytes = pingBytes; | ||
PongBytes = pongBytes; | ||
IsSSL = isSSL; | ||
OnlyEmitBytes = onlyEmitBytes; | ||
UseDisconnectBytes = useDisconnectBytes; | ||
DisconnectBytes = disconnectBytes; | ||
Token = token; | ||
|
||
if (UseDisconnectBytes && (DisconnectBytes == null || Statics.ByteArrayEquals(DisconnectBytes, Array.Empty<byte>()))) | ||
{ | ||
DisconnectBytes = new byte[] { 3 }; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
using Tcp.NET.Server.Models; | ||
using PHS.Core.Events.Args; | ||
|
||
namespace Tcp.NET.Server.Events.Args | ||
{ | ||
public class TcpAuthorizeBaseEventArgs<Z, A> : AuthorizeBaseEventArgs<Z> | ||
public class TcpAuthorizeBaseEventArgs<Z, A> : BaseArgs | ||
where Z : IdentityTcpServer<A> | ||
{ | ||
public Z Connection { get; set; } | ||
public string Token { get; set; } | ||
} | ||
} | ||
|
Oops, something went wrong.