public Sender(Receiver rec) { r = rec; Socks4aProxyClient proxy = new Socks4aProxyClient("127.0.0.1", 9050); clientConn = proxy.CreateConnection(MainClass.host, 6667); networkStream = clientConn.GetStream(); writer = new StreamWriter(networkStream); reader = new StreamReader(networkStream); writer.AutoFlush = true; }
public static void RunService(Object infos) { DataClient dat = infos as DataClient; String reason = Security.IPisBanned(((IPEndPoint)dat.ClientSock.Client.LocalEndPoint).Address.ToString()); if(reason != null){ StreamWriter writer = new StreamWriter(dat.ClientSock.GetStream()); writer.Write("ERROR :Closing link: (user@" + ((IPEndPoint)dat.ClientSock.Client.LocalEndPoint).Address.ToString() + ") [Error you are banned: " + reason + "]\r\n"); writer.Flush(); dat.ClientSock.Close(); }else{ if(dat.SSL){ ReceiverSSL sslr = new ReceiverSSL(dat.ClientSock); sslr.recv(); sslr.die(); }else{ Receiver r = new Receiver(dat.ClientSock); r.recv(); try { r.die(); }catch(Exception){ } } } }