• 大小: 91KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-04
  • 语言: Html/CSS
  • 标签:

资源简介

一次.net Socket UDP编程的10万客户端测试记录.包含客户端和服务器端,需要注意的是客户端里由于电脑端口问题,测试最好分多台电脑。 http://www.cnblogs.com/keyindex/archive/2010/12/15/1901875.html

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace SocketUdpClient
{
    class Program
    {
        static string serverIp;
        static string name = string.Empty;
        static int port1port2;
        static UdpClient client;
        static void Main(string[] args)
        {
            Console.WriteLine(“输入服务器IP地址“);
            serverIp = Console.ReadLine();
            Console.WriteLine(“输入接入端口“);
            port1 = int.Parse(Console.ReadLine());
            Console.WriteLine(“输入通信端口“);
            port2 = int.Parse(Console.ReadLine());

            while (running()) ;

            Console.ReadKey();
        }


        static bool running()
        {
            int txtNum;
            Console.WriteLine(“输入最大连接数“);
            txtNum = int.Parse(Console.ReadLine());
            client = new UdpClient(port1 port2 serverIp txtNum);

            for (int i = 0; i < txtNum; i++)
            {
                client.Start();
              
                Thread.Sleep(30);
            }
            return txtNum > 0;
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       6846  2010-12-13 16:06  SocketUdpClient\bin\Debug\Debug.rar

     文件       7168  2010-12-23 09:53  SocketUdpClient\bin\Debug\SocketUdpClient.exe

     文件      15872  2010-12-23 09:53  SocketUdpClient\bin\Debug\SocketUdpClient.pdb

     文件      14328  2010-12-23 09:52  SocketUdpClient\bin\Debug\SocketUdpClient.vshost.exe

     文件        490  2009-06-11 05:14  SocketUdpClient\bin\Debug\SocketUdpClient.vshost.exe.manifest

     文件       8704  2010-12-23 09:53  SocketUdpClient\bin\Debug\SocketUdpCore.dll

     文件      24064  2010-12-23 09:53  SocketUdpClient\bin\Debug\SocketUdpCore.pdb

     文件       3296  2010-12-23 09:53  SocketUdpClient\obj\Debug\ResolveAssemblyReference.cache

     文件        896  2010-12-23 09:53  SocketUdpClient\obj\Debug\SocketUdpClient.csproj.FileListAbsolute.txt

     文件       7168  2010-12-23 09:53  SocketUdpClient\obj\Debug\SocketUdpClient.exe

     文件      15872  2010-12-23 09:53  SocketUdpClient\obj\Debug\SocketUdpClient.pdb

     文件       1232  2010-12-13 15:29  SocketUdpClient\Program.cs

     文件       1374  2010-12-09 09:36  SocketUdpClient\Properties\AssemblyInfo.cs

     文件       2770  2010-12-09 14:11  SocketUdpClient\SocketUdpClient.csproj

     文件       3082  2010-12-13 16:24  SocketUdpClient\UdpClient.cs

     文件       8704  2010-12-23 09:53  SocketUdpCore\bin\Debug\SocketUdpCore.dll

     文件      24064  2010-12-23 09:53  SocketUdpCore\bin\Debug\SocketUdpCore.pdb

     文件       2574  2010-12-13 11:35  SocketUdpCore\BufferManager.cs

     文件       5120  2010-12-21 10:41  SocketUdpCore\obj\Debug\Refactor\SocketUdpCore.dll

     文件        628  2010-12-23 09:53  SocketUdpCore\obj\Debug\SocketUdpCore.csproj.FileListAbsolute.txt

     文件       8704  2010-12-23 09:53  SocketUdpCore\obj\Debug\SocketUdpCore.dll

     文件      24064  2010-12-23 09:53  SocketUdpCore\obj\Debug\SocketUdpCore.pdb

     文件       1370  2010-12-09 09:35  SocketUdpCore\Properties\AssemblyInfo.cs

     文件       1624  2010-12-13 11:00  SocketUdpCore\SocketAsyncEventArgsPool.cs

     文件       2655  2010-12-13 11:41  SocketUdpCore\SocketUdpCore.csproj

     文件       2733  2010-12-14 16:00  SocketUdpCore\UdpReceiveSocket.cs

     文件       3789  2010-12-21 10:57  SocketUdpCore\UdpSendSocket.cs

     文件       8704  2010-12-23 09:53  SocketUdpServer\bin\Debug\SocketUdpCore.dll

     文件      24064  2010-12-23 09:53  SocketUdpServer\bin\Debug\SocketUdpCore.pdb

     文件       7680  2010-12-23 09:53  SocketUdpServer\bin\Debug\SocketUdpServer.exe

............此处省略38个文件信息

评论

共有 条评论

相关资源