python手记-twisted(1)
来源:互联网 发布:成绩的等级c语言 编辑:程序博客网 时间:2024/05/04 00:50
Copyright (c) 2002-2015 NetSarang Computer, Inc. All rights reserved.
[myhaspl@iZ23mdqdp94Z ~]$ cat learn/l1/myserver.pl
from twisted.internet.protocol import Protocol
from twisted.internet import reactor
from twisted.internet.protocol import Factory
from twisted.internet.endpoints import TCP4ServerEndpoint
class Echo(Protocol):
def dataReceived(self,data):
self.transport.write(data)
class EchoFactory(Factory):
def buildProtocol(self,addr):
return Echo()
endpoint=TCP4ServerEndpoint(reactor,8001)
endpoint.listen(EchoFactory())
reactor.run()
[1] 27742
[myhaspl@iZ23mdqdp94Z l1]$ ps
PID TTY TIME CMD
27642 pts/0 00:00:00 bash
27742 pts/0 00:00:00 python
27747 pts/0 00:00:00 ps
Type `help' to learn how to use Xshell prompt.
本博客所有内容是原创,如果转载请注明来源
http://blog.csdn.net/myhaspl/
本地客户端远程telnet测试
[c:\~]$ telnet 120.55.x.x 8001Connecting to 120.55.x.x:8001...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
hello
hello
python
python
服务器上telnet测试
[myhaspl@iZ23mdqdp94Z l1]$ telnet 127.0.0.1 8001
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
hello,world
hello,world
hi
hi
本博客所有内容是原创,如果转载请注明来源
http://blog.csdn.net/myhaspl/
- python手记-twisted(1)
- python手记-twisted(2)
- python手记-twisted(3)
- python手记-twisted(4)
- python手记-twisted(5)
- Linux下Python网络编程框架-Twisted安装手记
- linux下Python网络编程框架-Twisted安装手记
- python twisted
- Python Twisted
- python Twisted
- python手记(1)
- python的twisted 学习
- Twisted python 入门例程
- python 安装TWisted
- python twisted中文教程
- Python Twisted学习总结
- Python Twisted介绍
- python twisted 笔记
- Linux常见单词缩写
- iOS 代理委托设计模式
- java基础-抽象类与接口的区别
- 新手学AngularJs之ng-app
- Android之删除指定联系人(本人采用Contact_ID)。
- python手记-twisted(1)
- PAT L2-012. 关于堆的判断(堆)
- [JavaScript]获取鼠标点击区域的相对、绝对位置坐标
- 一,iOS应用架构谈 开篇
- 菜鸟学步之Service通信(2)
- 多线程之多消费者与生产者
- RSA对称加密算法
- 利用FPGA设计IIR多相滤波器(0)
- win7下ie卸载后文件夹打开总新页面打开