import socketdef service_client(new_socket):"""为这个客户端返回数据"""# 1. 接收浏览器发送过来的请求 ,即http请求# GET / HTTP/1.1# .....request = new_socket.recv(1024)print(">>>" * 50)print(request)# 2. 返回http格式的数据,给浏览器# 2.1 准备发送给浏览器的数据---headerresponse = "HTTP/1.1 200 OK\r\n"response += "\r\n"# 2.2 准备发送给浏览器的数据---boy# response += "hahahhah"f = open("./html/index.html", "rb")html_content = f.read()f.close()# 将response header发送给浏览器new_socket.send(response.encode("utf-8"))# 将response body发送给浏览器new_socket.send(html_content)# 关闭套接new_socket.close()def main():"""用来完成整体的控制"""# 1. 创建套接字tcp_server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)tcp_server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)# 2. 绑定tcp_server_socket.bind(("", 7890))# 3. 变为监听套接字tcp_server_socket.listen(128)while True:# 4. 等待新客户端的链接new_socket, client_addr = tcp_server_socket.accept()# 5. 为这个客户端服务service_client(new_socket)# 关闭监听套接字tcp_server_socket.close()if __name__ == "__main__":main()
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE htmlPUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/doc/src/index.qdoc -->
<head><title>Qt 4.3: Qtopia Core Reference Documentation</title><link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="data:images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="data:images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">Qtopia Core Reference Documentation<br /><small>Qt for Embedded Linux</small></h1>
<a name="qt-reference-documentation"></a>        <table cellpadding="2" cellspacing="1" border="0" width="100%" bgcolor="#e5e5e5"><tr><th bgcolor="#a2c511" width="33%">Getting Started</th><th bgcolor="#a2c511" width="33%">General</th><th bgcolor="#a2c511" width="33%">Developer Resources</th></tr><tr><td valign="top"><ul><li><strong><a href="qt4-3-intro.html">What's New in Qt 4.3</a></strong></li><li><a href="how-to-learn-qt.html">How to Learn Qt</a></li><li><a href="installation.html">Installation</a></li><li><a href="tutorial.html">Tutorial</a> and <a href="examples.html">Examples</a></li><li><a href="porting4.html">Porting from Qt 3 to Qt 4</a></li></ul></td><td valign="top"><ul><li><a href="aboutqt.html">About Qt</a></li><li><a href="trolltech.html">About Trolltech</a></li><li><a href="commercialeditions.html">Commercial Edition</a></li><li><a href="opensourceedition.html">Open Source Edition</a></li><li><a href="http://www.trolltech.com/developer/faqs/">Frequently Asked Questions</a></li></ul></td><td valign="top"><ul><li><a href="http://lists.trolltech.com">Mailing Lists</a></li><li><a href="http://www.trolltech.com/developer/community/">Qt Community Web Sites</a></li><li><a href="http://doc.trolltech.com/qq/">Qt Quarterly</a></li><li><a href="bughowto.html">How to Report a Bug</a></li><li><a href="http://www.trolltech.com/developer/">Other Online Resources</a></li></ul></td></tr><tr><th bgcolor="#a2c511">API Reference</th><th bgcolor="#a2c511">Core Features</th><th bgcolor="#a2c511">Key Technologies</th></tr><tr><td valign="top"><ul><li><a href="classes.html">All Classes</a></li><li><a href="mainclasses.html">Main Classes</a></li><li><a href="groups.html">Grouped Classes</a></li><li><a href="annotated.html">Annotated Classes</a></li><li><a href="modules.html">Qt Classes by Module</a></li><li><a href="hierarchy.html">Inheritance Hierarchy</a></li><li><a href="functions.html">All Functions</a></li><li><a href="qtopiacore.html">Qtopia Core</a></li><li><a href="overviews.html">All Overviews and HOWTOs</a></li><li><a href="gallery.html">Qt Widget Gallery</a></li><li><a href="http://doc.trolltech.com/extras/qt43-class-chart.pdf">Class Chart</a></li></ul></td><td valign="top"><ul><li><a href="signalsandslots.html">Signals and Slots</a></li><li><a href="object.html">Object Model</a></li><li><a href="layout.html">Layout Management</a></li><li><a href="paintsystem.html">Paint System</a></li><li><a href="graphicsview.html">Graphics View</a></li><li><a href="accessible.html">Accessibility</a></li><li><a href="containers.html">Tool and Container Classes</a></li><li><a href="i18n.html">Internationalization</a></li><li><a href="plugins-howto.html">Plugin System</a></li><li><a href="intro-to-dbus.html">Inter-process Communication</a></li><li><a href="qtestlib-manual.html">Unit Testing Framework</a></li></ul></td><td valign="top"><ul><li><a href="threads.html">Multithreaded Programming</a></li><li><a href="qt4-mainwindow.html">Main Window Architecture</a></li><li><a href="richtext.html">Rich Text Processing</a></li><li><a href="model-view-programming.html">Model/View Programming</a></li><li><a href="stylesheet.html">Style Sheets</a></li><li><a href="qtnetwork.html">Network Module</a></li><li><a href="qtopengl.html">OpenGL Module</a></li><li><a href="qtsql.html">SQL Module</a></li><li><a href="qtsvg.html">SVG Module</a></li><li><a href="qtxml.html">XML Module</a></li><li><a href="qtscript.html">Script Module</a></li><li><a href="activeqt.html">ActiveQt Framework</a></li></ul></td></tr><tr><th bgcolor="#a2c511">Add-ons &amp; Services</th><th bgcolor="#a2c511">Tools</th><th bgcolor="#a2c511">Licenses &amp; Credits</th></tr><tr><td valign="top"><ul><li><a href="http://www.trolltech.com/products/qt/addon/solutions/">Qt Solutions</a></li><li><a href="http://www.trolltech.com/products/qt/3rdparty/">Partner Add-ons</a></li><li><a href="http://qt-apps.org">Third-Party Qt Components (qt-apps.org)</a></li><li><a href="http://www.trolltech.com/support/">Support</a></li><li><a href="http://www.trolltech.com/support/training/">Training</a></li></ul></td><td valign="top"><ul><li><a href="designer-manual.html">Qt Designer</a></li><li><a href="assistant-manual.html">Qt Assistant</a></li><li><a href="linguist-manual.html">Qt Linguist</a></li><li><a href="qmake-manual.html">qmake</a></li><li><a href="qttools.html">All Tools</a></li></ul></td><td valign="top"><ul><li><a href="gpl.html">GNU General Public License</a></li><li><a href="3rdparty.html">Third-Party Licenses Used in Qt</a></li><li><a href="licenses.html">Other Licenses Used in Qt</a></li><li><a href="trademarks.html">Trademark Information</a></li><li><a href="credits.html">Credits</a></li></ul></td></tr></table><p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>

返回index.html页面相关推荐

  1. h5 跳转上个页面刷新_关于javascript跳转与返回和刷新页面

    javascript中window.open()与window.location.href的区别 1.window.open('index.html') 表示新增一个窗口打开 index.html 这 ...

  2. SAP Spartacus SSR 模式下 index.html 页面渲染 fallback 到 CSR 之后的执行逻辑

    入口: 当SSR页面不能及时返回时,我们返回index.html: CSR 应用程序 CSR 应用会返回"Cache-Control: no-store"响应头.这将通知外部缓存系 ...

  3. asp+ajax菜单,AJAX_基于asp+ajax和数据库驱动的二级联动菜单,index.asp 页面代码 复制代码 代 - phpStudy...

    基于asp+ajax和数据库驱动的二级联动菜单 index.asp 页面代码 复制代码 代码如下: set cmd = conn.execute("select bigclassid,big ...

  4. 关于javascript跳转与返回和刷新页面

    javascript中window.open()与window.location.href的区别 window.open('index.html') 表示新增一个窗口打开 index.html 这个页 ...

  5. SpringBoot在controller返回一个HTML页面

    SpringBoot在controller返回一个HTML页面 本人今天在弄springBoot,因为第一次接触,遇到了很多的坑,特别是返回jsp页面.因为是新手所以一个人捣鼓了很长时间.终于弄好了. ...

  6. js 原生代码跳转页面,返回上一级页面

    标签形式跳转: <a href="www.baidu.com" target="_blank"> </a> 跳转到某个页面: windo ...

  7. vue返回上一页面时记忆回到原先滚动的位置

    因为vue是单页面应用,进入其他页面时会销毁该页面,用keep-alive不让其刷新,具体实现为: 1. 在App.vue中加入: <template><div id="a ...

  8. ajax绑值,AJAX请求,返回json进行页面绑值

    前台代码: index.html 去往含有ajax的页面 点我! queryList.html AJAX请求,返回json进行页面绑值 var name = "测试"; //测试与 ...

  9. 关于微信JSAPI支付成功后,点击完成后没有返回值并且页面被自动关闭问题

    微信JSAPI支付成功后,点击完成后没有返回值并且页面被自动关闭 简介 解决方式 错误的处理方式 总结 简介 最近很多人可能都遇到一个问题,在使用微信JSAPI支付成功后,不走成功的回调方法,只有支付 ...

最新文章

  1. 阿里云网盘内测_阿里云网盘内测,下载10M/s;百度网盘...?
  2. 打印机驱动程序属于计算机硬件吗,如何安装打印机驱动程序,详细教您如何给电脑安装打印机驱动程序...
  3. 初学laravel migrate常见错误解决
  4. DL之CNN:利用自定义DeepConvNet【7+1】算法对mnist数据集训练实现手写数字识别并预测(超过99%)
  5. 在 .NET 6 中使用 DATEONLY 和 TIMEONLY
  6. mysql可以存布尔_哪个MySQL数据类型用于存储布尔值
  7. 2008R2Win7管理九DNS冗余和恢复
  8. java 外螺旋矩阵_螺旋矩阵的java实现
  9. 开发辅助工具Kalman Studio2.0发布,内置基于T4的代码生成器
  10. 程序员,你得选准跑路的时间!
  11. linux下qt加载boost,信号槽的实现实例—— Qt 和 Boost
  12. 在ASP.NET MVC中使用Knockout实践07,自定义验证信息的位置与内容
  13. Win11开机桌面假死怎么办 win11开机桌面假死的解决方法
  14. [转]ETL模型设计
  15. [lammps教程]OVITO输出RDF
  16. python写诗代码_我们分析了超过50万首诗歌,教你用代码写诗(附代码)
  17. .NET启动时,出现无法加载MSXML3.dll
  18. OPPO小布助手正在改变普罗米修斯的世界
  19. 对HTML 标签语义化的理解,常见的语义化标签有哪些?
  20. 温度控制器matlab,某温度控制系统的MATLAB仿真.doc

热门文章

  1. 【bzoj 2435】[Noi2011]道路修建(dfs)
  2. 使用Hibernate生成数据库和连接数据库
  3. java 分层概念 要点
  4. 在一台服务器上配置多个Tomcat的方法
  5. 【struts2】struts2中对象的获取
  6. 【SRX】RE与PFE策略不同步,导致Commit失败-----案例分析
  7. 【译】 WebSocket 协议第六章——发送与接收消息(Sending and Receiving Data)
  8. 【Python】Docx解析
  9. 0507css3基础:弹性盒子、媒体查询
  10. 【20180202】使用iptables做MySQL的端口转发