diff options
author | marcinzelent <zelent.marcin@gmail.com> | 2018-03-17 00:37:41 -0700 |
---|---|---|
committer | marcinzelent <zelent.marcin@gmail.com> | 2018-03-17 00:37:41 -0700 |
commit | 017da9023af14430adc165b524ee50ae37ba9f5e (patch) | |
tree | cf330d55becbb1c777bef571e55962f1ac71542f /PasswordCrackerDistributed/PasswordCrackerServer/clientConnection.cs | |
parent | c684015a82de139e53b60a4805d18137b74c13ac (diff) |
Changes
Diffstat (limited to 'PasswordCrackerDistributed/PasswordCrackerServer/clientConnection.cs')
-rw-r--r-- | PasswordCrackerDistributed/PasswordCrackerServer/clientConnection.cs | 32 |
1 files changed, 14 insertions, 18 deletions
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<string> Doit()
+ public async Task<string> 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);
|