From 017da9023af14430adc165b524ee50ae37ba9f5e Mon Sep 17 00:00:00 2001 From: marcinzelent Date: Sat, 17 Mar 2018 00:37:41 -0700 Subject: Changes --- .../PasswordCrackerServer/clientConnection.cs | 32 ++++++++++------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'PasswordCrackerDistributed/PasswordCrackerServer/clientConnection.cs') diff --git a/PasswordCrackerDistributed/PasswordCrackerServer/clientConnection.cs b/PasswordCrackerDistributed/PasswordCrackerServer/clientConnection.cs index dc36679..c99d0be 100644 --- a/PasswordCrackerDistributed/PasswordCrackerServer/clientConnection.cs +++ b/PasswordCrackerDistributed/PasswordCrackerServer/clientConnection.cs @@ -1,37 +1,33 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; +using System.IO; using System.Net.Sockets; -using System.Text; using System.Threading.Tasks; namespace PasswordCrackerServer { class clientConnection { - public TcpClient connectionSocket { get; set; } - public string chunk { get; set; } - - public string pass { get; set; } + public TcpClient ConnectionSocket { get; set; } + public string Chunk { get; set; } + public string Pass { get; set; } public clientConnection(TcpClient connectionSocket, string chunk, string pass) { - this.connectionSocket = connectionSocket; - this.chunk = chunk; - this.pass = pass; + ConnectionSocket = connectionSocket; + Chunk = chunk; + Pass = pass; } - public async Task Doit() + public async Task SendToClient() { - Stream ns = connectionSocket.GetStream(); + Stream ns = ConnectionSocket.GetStream(); StreamReader sr = new StreamReader(ns); + StreamWriter sw = new StreamWriter(ns) + { + AutoFlush = true + }; - StreamWriter sw = new StreamWriter(ns); - sw.AutoFlush = true; - - sw.WriteLine($"DPCP 1.0\n{pass}\n{chunk}\n\n"); + sw.WriteLine($"DPCP 1.0\n{Pass}\n{Chunk}\n\n"); //sw.WriteLine(pass); //sw.WriteLine(chunk); -- cgit v1.2.3