原创文章,转载请注明: 转载自系统技术非业余研究 本文链接地址: ss is one another utility to investigate sockets(特适合大规模tcp链接) 具体的可以参考这里 他的最大特点是快, 当你的系统有上万个tcp链接要了解的时候的时候, 你就知道我说什么了. netstat等常规工具变成废铁了, 这时候他的作用就非常明显了. /proc interface is inadequate, unfortunately. When amount of sock
大家都知道, XP系统默认使用的是IPv4格式的IP地址, 而Win7系统默认使用的是IPv6格式的IP地址. 所以有些关于TCP连接的WinForm系统,在XP下可能运行正常,但在Win7下却不能运行. 故,需要在进行TCP连接的时候,需要对IP地址格式进行一个判断. 代码如下所示: //获取本机所有IP地址 IPAddress[] localips = Dns.GetHostAddresses(Dns.GetHostName());foreach (IPAddress ip in local
using System; using System.Net; /// <summary> /// 客户端通过TCP/IP连接服务端的方法,包含连接,发送数据,接收数据功能 /// </summary> using System.Net.Sockets; using System.Text; using System.Threading; public class LYL_TCP_Client { // 定义一个空的Socket对象 Socket socket = null; //
服务端: 代码: using System; using System.Collections.Generic; using System.IO; using System.Net; using System.Net.Sockets; using System.Text; using System.Threading; using System.Windows.Forms; namespace SocketStudy { public partial class Form1 : Form { p