日期:2014-05-17 浏览次数:20936 次
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
IPEndPoint ipep = new IPEndPoint(IPAddress.Parse("192.168.5.196"), 7010);
for (int i = 1; i < 1800; i++)
{
Socket socket = new Socket(ipep.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
socket.Connect("192.168.5.196", 7010);
if (socket.Connected)
{
Console.WriteLine("连接成功"+i);
}
}
Console.ReadLine();
for (int i = 1; i < 1800; i++)
{
Socket socket = new Socket(ipep.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
socket.Connect("192.168.5.196", 7010);
if (socket.Connected)