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

资源简介

tcp服务器目前实现的是 客户端发送什么数据,就把数据原样返回给客户端,如下图

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using System.Threading;
using System.IO;
using System.Net;
using System.Net.Sockets;


namespace TCPMultilink
{
    public partial class Form1 : Form
    {
        Thread listenThread = null;//监听进程

        public Form1()
        {
            InitializeComponent();
        }
        private static void StartListening() //main listening thread
        {
            IPEndPoint ipep = new IPEndPoint(IPAddress.Any 5555);//绑定5555端口
            Socket newsock = new Socket(AddressFamily.InterNetworkSocketType.Stream ProtocolType.Tcp);//tcp协议
            newsock.Bind(ipep);
            newsock.Listen(1

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

     文件       5612  2009-09-05 21:36  TCPMultilink\Properties\Resources.resx

     文件        249  2009-09-05 21:36  TCPMultilink\Properties\Settings.settings

     文件       1196  2009-09-05 21:36  TCPMultilink\Properties\AssemblyInfo.cs

     文件       2878  2009-09-05 21:36  TCPMultilink\Properties\Resources.Designer.cs

     文件       1095  2009-09-05 21:36  TCPMultilink\Properties\Settings.Designer.cs

     文件       3231  2009-09-05 21:47  TCPMultilink\TCPMultilink.csproj

     文件       5632  2005-12-08 14:51  TCPMultilink\bin\Debug\TCPMultilink.vshost.exe

     文件      20480  2009-09-06 09:14  TCPMultilink\bin\Debug\TCPMultilink.exe

     文件      24064  2009-09-06 09:14  TCPMultilink\bin\Debug\TCPMultilink.pdb

     文件        180  2009-09-05 21:50  TCPMultilink\obj\Debug\TCPMultilink.Form1.resources

     文件        180  2009-09-05 21:47  TCPMultilink\obj\Debug\TCPMultilink.Properties.Resources.resources

     文件      20480  2009-09-06 09:14  TCPMultilink\obj\Debug\TCPMultilink.exe

     文件        842  2009-09-05 21:50  TCPMultilink\obj\Debug\TCPMultilink.csproj.GenerateResource.Cache

     文件      24064  2009-09-06 09:14  TCPMultilink\obj\Debug\TCPMultilink.pdb

     文件        303  2009-09-06 09:14  TCPMultilink\obj\TCPMultilink.csproj.FileList.txt

     文件        471  2009-09-05 21:36  TCPMultilink\Program.cs

     文件       1605  2009-09-05 21:50  TCPMultilink\Form1.Designer.cs

     文件       5814  2009-09-05 21:50  TCPMultilink\Form1.resx

     文件       3522  2009-09-06 09:14  TCPMultilink\Form1.cs

     文件        925  2009-09-05 21:36  TCPMultilink.sln

     目录          0  2009-09-05 21:36  TCPMultilink\obj\Debug\TempPE

     目录          0  2009-09-05 21:36  TCPMultilink\bin\Debug

     目录          0  2009-09-05 21:36  TCPMultilink\obj\Debug

     目录          0  2009-09-05 21:36  TCPMultilink\Properties

     目录          0  2009-09-05 21:36  TCPMultilink\bin

     目录          0  2009-09-05 21:36  TCPMultilink\obj

     目录          0  2009-09-05 21:36  TCPMultilink

----------- ---------  ---------- -----  ----

               122823                    27



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

评论

共有 条评论