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

资源简介

socket心跳包

资源截图

代码片段和文件信息

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);

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2012-12-24 14:40  socket心跳包\
     目录           0  2012-12-24 14:40  socket心跳包\ConsoleApplication2\
     目录           0  2012-12-24 14:40  socket心跳包\ConsoleApplication2\ConsoleApplication2\
     文件         899  2012-12-21 16:22  socket心跳包\ConsoleApplication2\ConsoleApplication2.sln
     文件       21504  2012-12-21 17:24  socket心跳包\ConsoleApplication2\ConsoleApplication2.suo
     目录           0  2012-12-24 14:40  socket心跳包\ConsoleApplication2\ConsoleApplication2\bin\
     目录           0  2012-12-24 14:40  socket心跳包\ConsoleApplication2\ConsoleApplication2\bin\Debug\
     文件        6144  2012-12-21 17:04  socket心跳包\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe
     文件       15872  2012-12-21 17:04  socket心跳包\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.pdb
     文件       11600  2012-12-21 17:08  socket心跳包\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.vshost.exe
     文件         490  2010-03-17 22:39  socket心跳包\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.vshost.exe.manifest
     文件        2459  2012-12-21 16:22  socket心跳包\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.csproj
     目录           0  2012-12-24 14:40  socket心跳包\ConsoleApplication2\ConsoleApplication2\obj\
     目录           0  2012-12-24 14:40  socket心跳包\ConsoleApplication2\ConsoleApplication2\obj\x86\
     目录           0  2012-12-24 14:40  socket心跳包\ConsoleApplication2\ConsoleApplication2\obj\x86\Debug\
     文件         629  2012-12-21 17:08  socket心跳包\ConsoleApplication2\ConsoleApplication2\obj\x86\Debug\ConsoleApplication2.csproj.FileListAbsolute.txt
     文件        6144  2012-12-21 17:04  socket心跳包\ConsoleApplication2\ConsoleApplication2\obj\x86\Debug\ConsoleApplication2.exe
     文件       15872  2012-12-21 17:04  socket心跳包\ConsoleApplication2\ConsoleApplication2\obj\x86\Debug\ConsoleApplication2.pdb
     文件        5881  2012-12-21 17:04  socket心跳包\ConsoleApplication2\ConsoleApplication2\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     目录           0  2012-12-24 14:40  socket心跳包\ConsoleApplication2\ConsoleApplication2\obj\x86\Debug\TempPE\
     文件        2318  2012-12-21 17:04  socket心跳包\ConsoleApplication2\ConsoleApplication2\Program.cs
     目录           0  2012-12-24 14:40  socket心跳包\ConsoleApplication2\ConsoleApplication2\Properties\
     文件        1394  2012-12-21 16:22  socket心跳包\ConsoleApplication2\ConsoleApplication2\Properties\AssemblyInfo.cs
     目录           0  2012-12-24 14:39  socket心跳包\WindowsFormsApplication3\
     目录           0  2012-12-24 14:39  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\
     文件         914  2012-12-20 08:49  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3.sln
     文件       31744  2012-12-21 17:24  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3.suo
     目录           0  2012-12-24 14:39  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\bin\
     目录           0  2012-12-24 14:39  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\
     文件       11264  2012-12-21 16:50  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.exe
     文件       30208  2012-12-21 16:50  socket心跳包\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.pdb
............此处省略28个文件信息

评论

共有 条评论