using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.Net.Sockets;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
IPEndPoint ip = new IPEndPoint(Dns.GetHostAddresses("localhost")[0],8080);
List<TcpClient> TCPs = new List<TcpClient>();
int i = 1;
while (true) {
Console.Write(i + " ");
/* the exception's row */ TCPs.Add(new TcpClient(ip));
i++;
}
}
}
}
给我这个例外:
An attempt was made to access a socket in a way forbidden by its access permissions.