-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
31 lines (27 loc) · 781 Bytes
/
Program.cs
File metadata and controls
31 lines (27 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using MySql.Data.MySqlClient;
using System.Net.Sockets;
using System.Net;
namespace DBDesign // Note: actual namespace depends on the project name.
{
using Model;
internal class Program
{
async static Task Main(string[] args)
{
Test.TestQuery();
await MainLoop();
}
async static Task MainLoop()
{
TcpListener listener = new TcpListener(IPAddress.Any, 9090);
listener.Start();
while (true)
{
Socket client = await listener.AcceptSocketAsync();
Session session = new Session(client);
Console.WriteLine(client.RemoteEndPoint + " connected.");
session.Start();
}
}
}
}