udp_socket with thread to contect with each other
来源:互联网 发布:抢票软件 编辑:程序博客网 时间:2024/05/16 07:26
from threading import Threadfrom socket import *def sendinfo(): while True: sendinfo = input('<<') udpSocket.sendto(sendinfo.encode('utf-8'),adress)def recvinfo(): while True: recvinfo = udpSocket.recvfrom(1024) print("\r>>"+recvinfo[0].decode('utf-8')+' '+str(recvinfo[1]))udpSocket = socket(AF_INET,SOCK_DGRAM)udpSocket.bind(('',4567))adress = ('ip',port)def main(): ts = Thread(target = sendinfo) tr = Thread(target = recvinfo) ts.start() tr.start() ts.join() tr.join()if __name__ == '__main__': main()
阅读全文
0 0
- udp_socket with thread to contect with each other
- use pipe to contact with each other
- master communication with slave each other
- 【转载】Allowing applications to play nice(r) with each other: Handling remote control buttons
- setup cluster -- ssh to each other with no key ssh免密钥登陆配置
- If we can only encounter each other rather than stay with each other, then I wish we had never encou
- Communicating with Other Fragments
- Synchronization with other Devices
- Interacting with Other Apps
- Communicating with Other Fragments
- Use pthread_exit() To Terminate main() With The Other Threads Alive
- [other]Send email with Authentication
- android-Interacting with Other Apps
- Interacting with Other Apps笔记
- 《Training:Communicating with Other Fragments》
- 第一单元 Getting to Know Each Other
- Love is supporting each other , love just a thread
- Monitoring with Thread
- PAT 真题题解
- Simsci.ProII V8.2工艺流程模拟软件 使用教程手册资料Manual\
- poj 1011 Sticks
- Android framework系统默认设置修改
- hdu 6035(Colorful Tree)
- udp_socket with thread to contect with each other
- android studio的配置
- 如何理解泛型类的约束
- 小程序 scroll-view 滚动刷新数据 增加swiper切换
- CentOS 6 下升级安装Mysql 5.5 完整步骤
- Java类的实例化的几种方式
- vue项目中跳转到外部链接方法
- ECharts2.0横向显示柱状图
- MFC-为Button控件加载位图