diff options
author | Ricco Mandahl Jørgensen <riccojorgensen@gmail.com> | 2018-03-13 12:53:24 +0100 |
---|---|---|
committer | Ricco Mandahl Jørgensen <riccojorgensen@gmail.com> | 2018-03-13 12:53:24 +0100 |
commit | 54749b4012cddd9e80f26971dcf45fc352aead26 (patch) | |
tree | d7b08ab3ff8c0196a0041fa10abeed1a769a514d /PasswordCrackerDistributed/PasswordCrackerServer/clientConnection.cs |
First Commit
Diffstat (limited to 'PasswordCrackerDistributed/PasswordCrackerServer/clientConnection.cs')
-rw-r--r-- | PasswordCrackerDistributed/PasswordCrackerServer/clientConnection.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/PasswordCrackerDistributed/PasswordCrackerServer/clientConnection.cs b/PasswordCrackerDistributed/PasswordCrackerServer/clientConnection.cs new file mode 100644 index 0000000..ee086e1 --- /dev/null +++ b/PasswordCrackerDistributed/PasswordCrackerServer/clientConnection.cs @@ -0,0 +1,41 @@ +using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+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 clientConnection(TcpClient connectionSocket, string chunk, string pass)
+ {
+ this.connectionSocket = connectionSocket;
+ this.chunk = chunk;
+ this.pass = pass;
+ }
+
+ public async Task<string> Doit()
+ {
+ Stream ns = connectionSocket.GetStream();
+ StreamReader sr = new StreamReader(ns);
+
+ StreamWriter sw = new StreamWriter(ns);
+ sw.AutoFlush = true;
+
+ sw.WriteLine($"DPCP 1.0\n{pass}\n{chunk}");
+ //sw.WriteLine(pass);
+ //sw.WriteLine(chunk);
+
+ return sr.ReadLine();
+ }
+ }
+}
|