[Fix] Socket handshake separator fix (#146)

This commit is contained in:
HitPanda
2023-06-02 18:30:10 +03:00
committed by Aviu00
parent 6f549f0be9
commit ddd35d7b5b
2 changed files with 4 additions and 4 deletions

View File

@@ -52,7 +52,7 @@ public sealed class UtkaTCPServer : TcpServer
public void SendMessageToClient(UtkaTCPSession session, UtkaBaseMessage message)
{
session.SendAsync(JsonSerializer.Serialize(message, message.GetType()));
session.SendAsync(JsonSerializer.Serialize(message, message.GetType()) + "&%^sep^%&");
}
protected override void OnConnected(TcpSession session)

View File

@@ -28,13 +28,13 @@ public sealed class UtkaTCPSession : TcpSession
protected override void OnError(SocketError error)
{
SendAsync($"{error.ToString()}");
SendAsync($"{error.ToString()}&%^sep^%&");
base.OnError(error);
}
protected override void OnConnected()
{
SendAsync("Utka sosal handshake");
SendAsync("Utka sosal handshake&%^sep^%&");
base.OnConnected();
}
@@ -97,7 +97,7 @@ public sealed class UtkaTCPSession : TcpSession
if (!ValidateMessage(handle, out var message))
{
SendAsync("Validation fail");
SendAsync("Validation fail&%^sep^%&");
return;
}