Meine Lösung für Aufgabenblatt 2

This commit is contained in:
2014-03-25 20:36:22 +01:00
parent 8ca53e62dd
commit b93e11e986
4 changed files with 158 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
using System;
using System.IO;
using System.Net.Sockets;
using System.Text;
public class Sender
{
private NetworkStream NStream;
private Terminal Term;
public Sender (NetworkStream stream, Terminal terminal)
{
this.Term = terminal;
this.NStream = stream;
}
public void Send ()
{
while (true) {
String line = Term.ReadLine ();
line += "\n";
byte[] bytes = Encoding.UTF8.GetBytes(line);
NStream.Write (bytes, 0, bytes.Length);
}
}
}