当前位置: 首页 > news >正文

什么网站是专门做评论赚钱的响应式网站标准尺寸

什么网站是专门做评论赚钱的,响应式网站标准尺寸,网络规划方案计划书,狮山建网站---部分截图来自 siki学院Unity网络通讯课程 Socket 网络上的两个程序通过一个双向的通信连接实现数据交换#xff0c;这个连接的一端称为一个 Socket #xff0c;Socket 包含了网络通信必须的五种信息 Socket 例子{ 协议#xff1a; TCP 本地#xff1a; IP #xff…---部分截图来自 siki学院Unity网络通讯课程 Socket  网络上的两个程序通过一个双向的通信连接实现数据交换这个连接的一端称为一个 Socket Socket 包含了网络通信必须的五种信息 Socket 例子{  协议 TCP 本地 IP 端口 远程 IP 端口 } 可以通过ipconfignetstat   -ano 查看 Ip 和端口 创建客户端连接服务端 客户端代码 using System; using System.Net.Sockets;namespace wangluo {class Program{static void Main(string[] args){//创建一个Socket 需要using System.Net.Sockets;Socket tempClient new Socket(AddressFamily.InterNetwork,SocketType.Stream, ProtocolType.Tcp);tempClient.Connect(127.0.0.1, 8888);}} }服务端代码 using System; using System.Net.Sockets; using System.Net;namespace Server {class Program{static void Main(string[] args){Socket tempServer new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);IPEndPoint tempEndPoint new IPEndPoint(IPAddress.Parse(127.0.0.1), 8888); //using System.Net;tempServer.Bind(tempEndPoint); //绑定端口tempServer.Listen(0); //监听0表示挂起的队列无限长Console.WriteLine(服务端启动成功);Socket tempConnectClient tempServer.Accept();Console.WriteLine(客户端连接成功: tempConnectClient);}} }先开启服务端再开启客户端  客户端服务端互发信息 客户端代码 using System; using System.Net.Sockets; using System.Text;namespace wangluo {class Program{static void Main(string[] args){//创建一个Socket 需要using System.Net.Sockets;Socket tempClient new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);tempClient.Connect(127.0.0.1, 8888);//客户端向服务端发信息string tempSendInfo Console.ReadLine();//将字符串转换成 bufferbyte[] tempSendData Encoding.UTF8.GetBytes(tempSendInfo);//发送信息tempClient.Send(tempSendData);//接收来自服务端的信息byte[] tempReadBuffer new byte[1024];tempClient.Receive(tempReadBuffer);string tempReadString Encoding.UTF8.GetString(tempReadBuffer);Console.WriteLine(接收到服务端信息 tempReadString);}} }服务端代码 using System; using System.Net.Sockets; using System.Net; using System.Text;namespace Server {class Program{static void Main(string[] args){Socket tempServer new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);IPEndPoint tempEndPoint new IPEndPoint(IPAddress.Parse(127.0.0.1), 8888); //using System.Net;tempServer.Bind(tempEndPoint); //绑定端口tempServer.Listen(0); //监听0表示挂起的队列无限长Console.WriteLine(服务端启动成功);Socket tempConnectClient tempServer.Accept();Console.WriteLine(客户端连接成功: tempConnectClient);byte[] tempReadBuffer new byte[1024];tempConnectClient.Receive(tempReadBuffer);//将 byte 转换成字符串string tempReadString Encoding.UTF8.GetString(tempReadBuffer);Console.WriteLine(接收到客户端信息 tempReadString);//服务端向客户端发信息string tempSendInfo Console.ReadLine();byte[] tempSendData Encoding.UTF8.GetBytes(tempSendInfo);tempConnectClient.Send(tempSendData);}} }封装一下代码 客户端 using System; using System.Net.Sockets; using System.Text;namespace wangluo {class Program{static void Main(string[] args){//创建一个Socket 需要using System.Net.Sockets;Socket tempClient CreateSocket();tempClient.Connect(127.0.0.1, 8888);Send(tempClient);Receive(tempClient);}static Socket CreateSocket(){return new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);}static void Send(Socket tempClient){//客户端向服务端发信息string tempSendInfo Console.ReadLine();//将字符串转换成 bufferbyte[] tempSendData Encoding.UTF8.GetBytes(tempSendInfo);//发送信息tempClient.Send(tempSendData);}static void Receive(Socket tempClient){//接收来自服务端的信息byte[] tempReadBuffer new byte[1024];tempClient.Receive(tempReadBuffer);string tempReadString Encoding.UTF8.GetString(tempReadBuffer);Console.WriteLine(接收到服务端信息 tempReadString);}} }服务端 using System; using System.Net.Sockets; using System.Net; using System.Text;namespace Server {class Program{static void Main(string[] args){Socket tempServer CreateSocket();BindAndListen(tempServer);Socket tempConnectClient Accept(tempServer);Receive(tempConnectClient);Send(tempConnectClient);}static Socket CreateSocket(){return new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);}static void BindAndListen(Socket pSocket){IPEndPoint tempEndPoint new IPEndPoint(IPAddress.Parse(127.0.0.1), 8888); //using System.Net;pSocket.Bind(tempEndPoint); //绑定端口pSocket.Listen(0); //监听0表示挂起的队列无限长Console.WriteLine(服务端启动成功);}static Socket Accept(Socket pSocket){Socket tempConnectClient pSocket.Accept();Console.WriteLine(客户端连接成功: tempConnectClient);return tempConnectClient;}static void Receive(Socket pSocket){byte[] tempReadBuffer new byte[1024];pSocket.Receive(tempReadBuffer);//将 byte 转换成字符串string tempReadString Encoding.UTF8.GetString(tempReadBuffer);Console.WriteLine(接收到客户端信息 tempReadString);}static void Send(Socket pSocket){//服务端向客户端发信息string tempSendInfo Console.ReadLine();byte[] tempSendData Encoding.UTF8.GetBytes(tempSendInfo);pSocket.Send(tempSendData);}} }Socket 代码解析 AddressFamily: InterNetwork 使用IPv4    InterNetworkV6 使用IPv6 SocketType
http://www.zqtcl.cn/news/316914/

相关文章:

  • 弹幕网站开发难么招生网站建设的意义
  • 网站空间多大合适软件开发培训机构网课
  • 13个实用平面设计网站网络推广一个月的收入
  • 淮安企业网站制作校园网网络规划与设计方案
  • html完整网站开发自媒体平台账号注册
  • 厦门seo网站网站空间 群集
  • 青岛网站推广方案营销自动化平台
  • 管理信息系统与网站建设有什么区别python版wordpress
  • 济南市建设行政主管部门网站公众号登录入口官网
  • 深圳苏州企业网站建设服务企业做网站需要什么条件
  • 电脑什么网站可以做长图攻略公众号 微网站开发
  • 网站核检单怎么用小皮创建网站
  • 企业网站托管平台有哪些烟台高新区建设局网站
  • 石家庄网站做网站和县网页定制
  • 网站个人备案和企业备案潍坊公司注册网站
  • 建个网站的流程互联网裁员
  • 设置网站模板汉口网站建设公司
  • 网站对一个关键词做排名怎么做网站建设 图纸网
  • 什么网站比较吸引流量网页设计代码td
  • 克隆网站怎么做后台wordpress网站缩
  • 仁怀哪儿做网站泰安市建设局
  • 做网站和编程有关系吗手机怎么做电子书下载网站
  • 网站做关键词排名网站快速排名的方法
  • 有网站模板如何预览泉州app开发
  • 网站自助建站系统重庆皇华建设集团有限公司网站
  • 云速成美站做网站好吗汕头制作网站
  • 搜狗搜索网站提交入口在哪里做卖车网站
  • 河南省百城建设提质网站新人怎么做电商
  • 建设机械网站制作创建个人网站教案
  • 无锡网站推广装修风格大全2023新款