Excelente, Y eso que esta echo a lo rápido, pero quedo muy bien, voy a modificarlo con tu permiso.
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Net;
namespace MuestraClienteMultiple{
class program {
public class Conexion {
byte[] buffer;
TcpClient client;
string host;
public Conexion(string hostname, int bufferSize){
host =hostname;
buffer
= new Byte[bufferSize
]; }
public string GetData(){
string result=String.Empty;
try{
client Connect(s, 80);
if (client.Connected) {
StreamReader sr
= new StreamReader
(client
.GetStream()); result= sr.ReadToEnd());
}
}
finally{
conex.Close();
}
return result;
}
}
static int main() {
string[] hosts = { "google.com", "www.raul338.com.ar" }; // direcciones servidor
List
<Conexion
> conexiones
= new List
<Conexion
>(hosts
.Length); // Lista del mismo tamaño de las direcciones
foreach (string s in hosts) {
Conexion conex
= new Conexion
(x,
2048); //conex.buffer = new Byte[2048]; // 2 Mb de buffer
//conex.client = new TcpClient(); // Direccion en el puerto 80
conexiones.Add(conex);
Console.WriteLine(conex.GetData());
} // foreach
}
}// class program
}// namespace