More bullshit added.

This commit is contained in:
Aareschluchtje
2015-10-05 12:59:05 +02:00
parent 75d3bf1ec0
commit c8f32ced43
4 changed files with 63 additions and 4 deletions
+28
View File
@@ -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()
{
}
}
}
+23 -3
View File
@@ -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 namespace ErgometerServer
{ {
@@ -8,7 +12,7 @@ namespace ErgometerServer
Server server; Server server;
string name; string name;
int session; ArrayList threads;
bool running; bool running;
bool loggedin; bool loggedin;
@@ -19,14 +23,30 @@ namespace ErgometerServer
this.client = client; this.client = client;
this.server = server; this.server = server;
this.name = "Unknown"; this.name = "Unknown";
this.session = 0; this.threads = new ArrayList();
this.running = false; this.running = false;
this.loggedin = false; this.loggedin = false;
} }
public void run() 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;
} }
} }
} }
+1
View File
@@ -47,6 +47,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="ClientThread.cs" /> <Compile Include="ClientThread.cs" />
<Compile Include="DoctorSessionThread.cs" />
<Compile Include="DoctorThread.cs" /> <Compile Include="DoctorThread.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Server.cs" /> <Compile Include="Server.cs" />
+11 -1
View File
@@ -17,7 +17,7 @@ namespace ErgometerServer
new Server(); new Server();
} }
private List<ClientThread> clients; public List<ClientThread> clients { get; }
private DoctorThread doctor; private DoctorThread doctor;
public Server() public Server()
@@ -72,5 +72,15 @@ namespace ErgometerServer
Thread thread = new Thread(new ThreadStart(doctor.run)); Thread thread = new Thread(new ThreadStart(doctor.run));
thread.Start(); thread.Start();
} }
public void sendToDoctor()
{
}
public void sendToClient(int session)
{
}
} }
} }