(tools, client, server) feat: Remove gRPC support, add TCP back and reorganized project
This commit is contained in:
19
Client/Assets/Scripts/Test/TcpClientTest.cs
Normal file
19
Client/Assets/Scripts/Test/TcpClientTest.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using Network;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Test
|
||||
{
|
||||
public class TcpClientTest : MonoBehaviour
|
||||
{
|
||||
private async void Start()
|
||||
{
|
||||
var sendBytes = Encoding.UTF8.GetBytes("This is a test string sent via TCP.");
|
||||
|
||||
var receivedBytes = await UnityTcpClient.Instance.SendAndReceiveData(sendBytes);
|
||||
var receivedString = Encoding.UTF8.GetString(receivedBytes);
|
||||
|
||||
Debug.Log($"Received string: {receivedString}");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user