26 lines
461 B
C#
26 lines
461 B
C#
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);
|
|
}
|
|
}
|
|
} |