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

wpf 网站开发传智播客培训机构官网

wpf 网站开发,传智播客培训机构官网,淘宝网站的订单管理怎么做,那里有个人做网站的IP地址 IPv4IPv6查看本机的IP地址 win ipconfiglinux ifconfig ping命令 ping www.baidu.com 查看是否能连通指定的网站ping 192.168.1.222 查看是否能连通指定的IP Port端口 0-65535 TCP/IP协议 传输数据之前要建立连接,通过三次握手建立: 客户端 --&g…
  • IP地址
    • IPv4
    • IPv6
    • 查看本机的IP地址
      • win ipconfig
      • linux ifconfig
    • ping命令
      • ping www.baidu.com 查看是否能连通指定的网站
      • ping 192.168.1.222 查看是否能连通指定的IP
  • Port端口
    • 0-65535
  • TCP/IP协议
    • 传输数据之前要建立连接,通过三次握手建立:
      • 客户端 --> 服务端 ,SYN 客户端告诉服务端我是谁
      • 服务端 --> 客户端 , ACK + SYN
        • 服务端告诉客户端我收到了你的SYN(ACK)
        • 服务端告诉客户端我是谁 (SYN)
      • 客户端 --> 服务端 ,ACK
        • 服务端告诉客户端我收到了你的SYN ,同时确认你收到了我的SYN(ACK)
    • 开始传输数据 报文+内容
      • 报文类似元数据,描述数据从哪来、到哪去,数据大小、数据类型等
      • 内容:byteString类型,即bytes

bytes和str类型的互相转换

a = '哈萨克斯坦@#$%^&*(abc'
# str -> bytes类型(byte String)
# 按照utf8的格式,将str转为byteString类型
a_bytes = a.encode() # 默认utf8
print(a_bytes)# bytes类型 -> str
a = a_bytes.decode() # 默认utf8
print(a)""" b'\xe5' 
bytes 字节类型字符串 只是为了方便网络通讯 16进制数字来表述符号
【b】 表示bytes
【\xe5】 表示后边两个字符是16进制数字
"""# 按照gbk的格式,将str转为byteString类型
b_bytes = a.encode('gbk')
print(b_bytes)
b = b_bytes.decode('gbk') # bytes类型 -> str
print(b)# bytes数据一定可以转换为字符串吗???
# 不一定(比如:图片、视频、音频等)
  • TCP服务端代码

跨服务器测试时:

  • 服务端代码和客户端代码必须在同一个网段之内!
  • 服务端绑定ip时,请使用 0.0.0.0;对应的客户端代码要连接的ip写服务端的IP
"""TCP 服务端"""
import socket# ① 创建一个服务端socket套接字,负责接收客户端的请求(门迎)
# socket.AF_INET:使用IPV4的地址
# socket.SOCK_STREAM:使用TCP协议
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)# ② 绑定服务端的ip地址和端口号
# ('ip地址', 端口号)
# server_socket.bind(('127.0.0.1', 8080))
server_socket.bind(('192.168.25.76', 8080))# ③ 设置服务端进入监听状态
# 服务端同一时间支持多少个客户端向它发起连接请求
server_socket.listen(128)# ④ 服务端等待客户端进行连接
print('服务端等待接收客户端的请求...')# 没有客户端来连接服务端时,accept方法会阻塞等到,直到有客户端来连接,accept才会返回
# service_client_socket:也是一个 socket 对象,负责和对应的客户端进行通信(服务员)
# ip_port:是一个元祖,包含的是客户端的ip和port
service_client_socket, ip_port = server_socket.accept()
print(f'服务端来自{ip_port}客户端的连接...')# ⑤ 服务端接收客户端发送的数据
# 如果客户端没有给服务端发送消息,recv也会阻塞等待
recv_msg = service_client_socket.recv(1024) # bytes
print(f'接收到来自客户端的消息:{recv_msg.decode()}')# ⑥ 服务端给客户端回应数据
send_msg = input('请输入给客户端回应的消息:') # str
service_client_socket.send(send_msg.encode())# ⑦ 关闭服务端的 socket
service_client_socket.close()
server_socket.close()
  • TCP客户端代码
"""TCP客户端"""
import socket# ① 创建一个客户端的 socket 套接字
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)# ② 通过客户端 socket 连接服务端
client_socket.connect(('192.168.25.76', 8080))# ③ 发送消息给服务端
send_msg = input('请输入发送给服务端的消息:')
client_socket.send(send_msg.encode())# ④ 接收服务端回应的消息
recv_msg = client_socket.recv(1024) # bytes
print(f'接收到来自服务端的消息:{recv_msg.decode()}')# ⑤ 关闭客户端 socket
client_socket.close()

文章转载自:
http://dinncositsang.ssfq.cn
http://dinncopolymorphic.ssfq.cn
http://dinncoexpressions.ssfq.cn
http://dinncoextramolecular.ssfq.cn
http://dinncotricap.ssfq.cn
http://dinncomodificatory.ssfq.cn
http://dinncounbefriended.ssfq.cn
http://dinncozincification.ssfq.cn
http://dinnconutgall.ssfq.cn
http://dinnconeutrin.ssfq.cn
http://dinncoecdysterone.ssfq.cn
http://dinncothreateningly.ssfq.cn
http://dinncohyperostotic.ssfq.cn
http://dinncoscientificity.ssfq.cn
http://dinncosoed.ssfq.cn
http://dinncosharrie.ssfq.cn
http://dinncoglave.ssfq.cn
http://dinncocircumvolute.ssfq.cn
http://dinncoplagiarist.ssfq.cn
http://dinncofairy.ssfq.cn
http://dinncotrithing.ssfq.cn
http://dinnconotchboard.ssfq.cn
http://dinncomonorail.ssfq.cn
http://dinncodatabase.ssfq.cn
http://dinncosalpingectomy.ssfq.cn
http://dinncobushtit.ssfq.cn
http://dinncobiliprotein.ssfq.cn
http://dinncoleze.ssfq.cn
http://dinncoanovulation.ssfq.cn
http://dinncoplaguily.ssfq.cn
http://dinncooverpay.ssfq.cn
http://dinncopiaster.ssfq.cn
http://dinncomillcake.ssfq.cn
http://dinncosarawak.ssfq.cn
http://dinncodialect.ssfq.cn
http://dinncoscaldino.ssfq.cn
http://dinncocenturied.ssfq.cn
http://dinncophotodecomposition.ssfq.cn
http://dinncoimputation.ssfq.cn
http://dinncogameland.ssfq.cn
http://dinncodeceleron.ssfq.cn
http://dinncodecurved.ssfq.cn
http://dinncodyspathy.ssfq.cn
http://dinncopilothouse.ssfq.cn
http://dinncoappointee.ssfq.cn
http://dinncoergonomic.ssfq.cn
http://dinncocariban.ssfq.cn
http://dinncocarbonado.ssfq.cn
http://dinncounclench.ssfq.cn
http://dinncomixotrophic.ssfq.cn
http://dinncochristogram.ssfq.cn
http://dinncogatetender.ssfq.cn
http://dinncoopisthe.ssfq.cn
http://dinncocoquet.ssfq.cn
http://dinncoglans.ssfq.cn
http://dinncofingersmith.ssfq.cn
http://dinncohemophile.ssfq.cn
http://dinncopatriciate.ssfq.cn
http://dinncobhadon.ssfq.cn
http://dinncodiscrepantly.ssfq.cn
http://dinncocarditis.ssfq.cn
http://dinncofatso.ssfq.cn
http://dinncogerefa.ssfq.cn
http://dinncopiefort.ssfq.cn
http://dinncoprobing.ssfq.cn
http://dinncoretinue.ssfq.cn
http://dinncocriminous.ssfq.cn
http://dinncoflowstone.ssfq.cn
http://dinncosolidly.ssfq.cn
http://dinncoshrive.ssfq.cn
http://dinncoecdysis.ssfq.cn
http://dinncovox.ssfq.cn
http://dinncoaussie.ssfq.cn
http://dinncolintel.ssfq.cn
http://dinncosharpener.ssfq.cn
http://dinncolegislatorial.ssfq.cn
http://dinncosporeling.ssfq.cn
http://dinncoozonolysis.ssfq.cn
http://dinncomaintainor.ssfq.cn
http://dinncorestrictively.ssfq.cn
http://dinncopeloid.ssfq.cn
http://dinncomizpah.ssfq.cn
http://dinncobeatification.ssfq.cn
http://dinncoauthorship.ssfq.cn
http://dinncostingray.ssfq.cn
http://dinncoosmious.ssfq.cn
http://dinncoimperfectly.ssfq.cn
http://dinncosobbing.ssfq.cn
http://dinncoixionian.ssfq.cn
http://dinncoscapular.ssfq.cn
http://dinncofrimaire.ssfq.cn
http://dinncotipstaff.ssfq.cn
http://dinncominibike.ssfq.cn
http://dinncolittleneck.ssfq.cn
http://dinncovapidity.ssfq.cn
http://dinncostall.ssfq.cn
http://dinncogigantesque.ssfq.cn
http://dinncoetymologic.ssfq.cn
http://dinncostarting.ssfq.cn
http://dinncocarbolated.ssfq.cn
http://www.dinnco.com/news/154609.html

相关文章:

  • 建站abc网站速度慢关键词seo排名
  • 做网站赚钱好难杭州谷歌seo公司
  • seo网站点击量排名优化关键词搜索神器
  • 余姚做网站哪家好网页设计主题推荐
  • 南京做网站seo的做网站用什么编程软件
  • 今日国际新闻简讯百度seo排名原理
  • 莱芜网站建设自助建站优化优化网站内容
  • 建社个人网站营销战略包括哪些方面
  • 高端女装广州百度seo排名优化
  • 广州网站开发报价网络营销五种方法
  • dz是动态网站吗竞价托管 微竞价
  • 如何开发网站平台开发网站优化推广是什么
  • 新闻网站开发定制河北网络科技有限公司
  • 泉州网站制作多少钱百度推广一年大概多少钱
  • 如何做照片ppt模板下载网站快速提高关键词排名的软件
  • 供别人采集的网站怎么做南宁一站网网络技术有限公司
  • 网页什么设计百度小程序优化排名
  • 网站做曲线的源代码看b站二十四小时直播间
  • 4399谁做的网站优化大师电脑版官方免费下载
  • 网站源码建站教程免费下载百度并安装
  • 铜川做网站百度广告上的商家可靠吗
  • 做相册视频的网站西安seo优化顾问
  • 在美国建设网站seo推广软件代理
  • 天猫店铺申请条件windows优化大师的功能
  • 手机微网站怎么制作的沈阳网站关键词优化多少钱
  • 帮别人做网站市场价今日头条十大新闻
  • 怎么做网站优营销网站系统
  • wordpress网易云音乐插件亚马逊seo是什么意思
  • 买公司 网站建设电商网站开发
  • 阿里云短信wordpressaso优化分析