More bullshit added.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ErgometerServer
|
||||
{
|
||||
class DoctorSessionThread
|
||||
{
|
||||
private int session;
|
||||
private TcpClient client;
|
||||
private DoctorThread doctor;
|
||||
|
||||
public DoctorSessionThread(int session, TcpClient client, DoctorThread doctor)
|
||||
{
|
||||
this.session = session;
|
||||
this.client = client;
|
||||
this.doctor = doctor;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,8 @@
|
||||
using System.Net.Sockets;
|
||||
using System.Collections;
|
||||
using System.Net.Sockets;
|
||||
using System.Runtime.Remoting.Lifetime;
|
||||
using System.Threading;
|
||||
using ErgometerLibrary;
|
||||
|
||||
namespace ErgometerServer
|
||||
{
|
||||
@@ -8,7 +12,7 @@ namespace ErgometerServer
|
||||
Server server;
|
||||
|
||||
string name;
|
||||
int session;
|
||||
ArrayList threads;
|
||||
|
||||
bool running;
|
||||
bool loggedin;
|
||||
@@ -19,14 +23,30 @@ namespace ErgometerServer
|
||||
this.client = client;
|
||||
this.server = server;
|
||||
this.name = "Unknown";
|
||||
this.session = 0;
|
||||
this.threads = new ArrayList();
|
||||
this.running = false;
|
||||
this.loggedin = false;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
running = true;
|
||||
loggedin = true;
|
||||
while (loggedin && running)
|
||||
{
|
||||
if (threads.Count < server.clients.Count)
|
||||
{
|
||||
DoctorSessionThread dt = new DoctorSessionThread(1, client, this);
|
||||
threads.Add(dt);
|
||||
Thread thread = new Thread(new ThreadStart(dt.run));
|
||||
thread.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void logout()
|
||||
{
|
||||
loggedin = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,6 +47,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ClientThread.cs" />
|
||||
<Compile Include="DoctorSessionThread.cs" />
|
||||
<Compile Include="DoctorThread.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Server.cs" />
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace ErgometerServer
|
||||
new Server();
|
||||
}
|
||||
|
||||
private List<ClientThread> clients;
|
||||
public List<ClientThread> clients { get; }
|
||||
private DoctorThread doctor;
|
||||
|
||||
public Server()
|
||||
@@ -72,5 +72,15 @@ namespace ErgometerServer
|
||||
Thread thread = new Thread(new ThreadStart(doctor.run));
|
||||
thread.Start();
|
||||
}
|
||||
|
||||
public void sendToDoctor()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void sendToClient(int session)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user