• 大小: 0.08M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2020-12-25
  • 语言: C#
  • 标签: Socket  C#  心跳包  

资源简介


资源截图

代码片段和文件信息

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

namespace ConsoleApplication2
{
    class Program
    {
        public static TcpListener tcpListener;
        public static int port = 9070;
        public static IPAddress ipAddress = IPAddress.Parse(“127.0.0.1“);
        public static void Start()
        {
            tcpListener = new TcpListener(ipAddress port);
            tcpListener.Start();//开始监听IPEndPort
            Console.WriteLine(“begin listen port{0}“port);
            while (true)
            {
                byte[] buffer = new byte[100];
                Socket newClient = tcpListener.AcceptSocket();
                newClient.Receive(buffer);

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

     文件       6144  2014-04-01 16:26  socket心跳包\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe

     文件      15872  2014-04-01 16:26  socket心跳包\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.pdb

     文件      14848  2014-04-01 16:27  socket心跳包\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.vshost.exe

     文件        490  2007-07-21 01:33  socket心跳包\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.vshost.exe.manifest

     文件       2459  2012-12-21 16:22  socket心跳包\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.csproj

     文件       1338  2014-04-01 16:27  socket心跳包\ConsoleApplication2\ConsoleApplication2\obj\x86\Debug\ConsoleApplication2.csproj.FileListAbsolute.txt

     文件       6144  2014-04-01 16:26  socket心跳包\ConsoleApplication2\ConsoleApplication2\obj\x86\Debug\ConsoleApplication2.exe

     文件      15872  2014-04-01 16:26  socket心跳包\ConsoleApplication2\ConsoleApplication2\obj\x86\Debug\ConsoleApplication2.pdb

     文件       5881  2012-12-21 17:04  socket心跳包\ConsoleApplication2\ConsoleApplication2\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       2318  2012-12-21 17:04  socket心跳包\ConsoleApplication2\ConsoleApplication2\Program.cs

     文件       1394  2012-12-21 16:22  socket心跳包\ConsoleApplication2\ConsoleApplication2\Properties\AssemblyInfo.cs

     文件        899  2012-12-21 16:22  socket心跳包\ConsoleApplication2\ConsoleApplication2.sln

    ..A..H.     21504  2012-12-21 17:24  socket心跳包\ConsoleApplication2\ConsoleApplication2.suo

     文件      11264  2014-04-01 16:26  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.exe

     文件      32256  2014-04-01 16:26  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.pdb

     文件      14848  2014-04-01 16:26  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.vshost.exe

     文件        490  2007-07-21 01:33  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.vshost.exe.manifest

     文件       4639  2012-12-21 16:50  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\Form1.cs

     文件       4216  2012-12-21 15:17  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\Form1.Designer.cs

     文件       5817  2012-12-21 15:17  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\Form1.resx

     文件       4440  2012-12-21 08:07  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6389  2012-12-21 16:50  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        456  2012-12-21 15:20  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\GenerateResource.read.1.tlog

     文件       1078  2012-12-21 15:20  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\GenerateResource.write.1.tlog

     文件     103353  2014-04-01 16:26  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\ResolveAssemblyReference.cache

     文件       2618  2014-04-01 16:26  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\WindowsFormsApplication3.csproj.FileListAbsolute.txt

     文件        774  2014-04-01 16:26  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\WindowsFormsApplication3.csproj.GenerateResource.Cache

     文件      11264  2014-04-01 16:26  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\WindowsFormsApplication3.exe

     文件        180  2014-04-01 16:26  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\WindowsFormsApplication3.Form1.resources

     文件      32256  2014-04-01 16:26  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\WindowsFormsApplication3.pdb

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

评论

共有 条评论