Implementation umgebaut, sodass sie besser der Aufgabenstellung entspricht
This commit is contained in:
@@ -4,21 +4,18 @@ using System.Net.Sockets;
|
||||
|
||||
class Receiver
|
||||
{
|
||||
private TcpClient Client;
|
||||
private StreamReader Reader;
|
||||
private Terminal Term;
|
||||
|
||||
public Receiver (NetworkStream stream, Terminal terminal)
|
||||
public Receiver (TcpClient client)
|
||||
{
|
||||
this.Reader = new StreamReader(stream);
|
||||
this.Term = terminal;
|
||||
this.Client = client;
|
||||
this.Reader = new StreamReader(Client.GetStream());
|
||||
}
|
||||
|
||||
public void Receive ()
|
||||
public string Receive ()
|
||||
{
|
||||
while (true) {
|
||||
String line = Reader.ReadLine();
|
||||
Term.PrintLine(line);
|
||||
}
|
||||
return Reader.ReadLine();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user