Initial Server & Client Commit

Started on Interfaces
- Created IManager
- Created IPacket
Started on Managers
- Created Packet Manager
Started on async client/server implementation
This commit is contained in:
PALMER
2021-12-03 15:42:14 +10:00
parent 46405a8cf4
commit 2e9a712e71
5 changed files with 139 additions and 0 deletions

47
Client.cs Normal file
View File

@ -0,0 +1,47 @@
using Articulate_Network.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace Articulate_Network
{
public class Client
{
List<IManager> managers = new List<IManager>();
TcpClient tcp;
public Client()
{
tcp = new TcpClient();
}
public async Task<TcpClient> Connect(string ip, int port)
{
return await Task.Run(() =>
{
try
{
tcp.Connect(ip, port);
return tcp;
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return tcp;
}
}
);
}
public async Task<bool> SendPacket(IPacket packet)
{
return false;
}
}
}